在C#控制台应用程序中打印文档 [英] Print document in c# console app

查看:61
本文介绍了在C#控制台应用程序中打印文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在控制台应用程序中打印任何文档类型,我尝试过使用System.Drawing.Printing,但在VS中找不到. System.Drawing.Printing.PrintDocument printDocument =新的System.Drawing.Printing.PrintDocument();

I need to print any doc type in console app, i tried using System.Drawing.Printing, but it could not be found in VS. System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument();

推荐答案

这对我有用:

    ProcessStartInfo info = new ProcessStartInfo(filePath);
    info.Verb = "Print";
    info.CreateNoWindow = true;
    info.WindowStyle = ProcessWindowStyle.Hidden;
    Process.Start(info);

这篇关于在C#控制台应用程序中打印文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆