Print document in c# console app

我只是一个虾纸丫 提交于 2021-01-05 06:56:24

问题


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();


回答1:


This worked for me:

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


来源:https://stackoverflow.com/questions/51926369/print-document-in-c-sharp-console-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!