批量打印pdf文档 [英] Batch printing of pdf document
本文介绍了批量打印pdf文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
>大家好,
我想一键打印多个pdf文档而不会杀死adobe exe。
我试过下面代码,但它只打印成功,但其余的文件不打印。
所以,任何解决方案都将受到高度赞赏。
Pushkar
我尝试过:
>Hi Everyone,
I want to print multiple pdf document on one click without killing adobe exe.
I tried below code but it prints only first sucessfully but rest of document does not print.
So please any solution will be highly appreciated.
Pushkar
What I have tried:
Process oProcess = new Process();
try
{
oProcess.StartInfo.FileName = PDFFilePath;
oProcess.StartInfo.UseShellExecute = true;
oProcess.StartInfo.CreateNoWindow = true;
oProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
oProcess.StartInfo.Verb = "print";
oProcess.Start();
if (oProcess.HasExited == false)
{
oProcess.WaitForExit(10000);
}
Success = true;
}
catch (InvalidOperationException ex)
{
throw ex;
}
catch (IOException ex)
{
throw ex;
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (oProcess != null)
{
oProcess = null;
}
}
推荐答案
如果您已经有PDF文档,我不明白为什么您需要使用Adobe打印它们,因为你不需要对话 - 为什么不直接将文件发送到打印机? (见链接)
如何以编程方式(C#.NET)将pdf文件直接打印到打印机vishalsbsinha [ ^ ]
If you have PDF documents already, I dont see why you need to use Adobe to print them, since you dont need a dialogue - why not send the documents directly to the printer ? (see link)
How to programmatically (C# .NET) print a pdf file directly to the printer | vishalsbsinha[^]
这篇关于批量打印pdf文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文