繁体   English   中英

使用process.start打印多个文件

[英]Printing multiple files using process.start

在这里,我有打开Adobe并使其使用Process.Start()打印PDF文件的代码。 我正在尝试使用同一命令打印多个文件(两个不同的pdf)。 我将如何处理? 这是我到目前为止的内容:

 Process profilePrintProcess = new Process();
                profilePrintProcess.EnableRaisingEvents = true;
                profilePrintProcess.StartInfo = new ProcessStartInfo()
                {
                    CreateNoWindow = true,
                    Verb = "PrintTo",
                    FileName = "[" + profFileName + " " + contractFileName + "]",
                    WindowStyle = ProcessWindowStyle.Hidden,
                };

                profilePrintProcess.Start();

我一直在将此链接作为另一个引用类似问题的SO问题的指南。

要通过Acrobat Reader打印单个文件,请尝试以下操作,并让我知道是否有效:

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "AcroRd32.exe";
startInfo.Arguments = "/p " + YourPDFFilePath;
process.StartInfo = startInfo;
process.Start();

要先打印multiigile pdf文件,然后再将其打印成PDFSharp

var outputPDFDocument = PdfDocument.Combine("Output.pdf", "doc1.pdf", "doc2.pdf", "doc3.pdf");
outputPDFDocument.Save("C:\\temp.pdf"); 

PdfFilePrinter.AdobeReaderPath = @"C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe";  
PdfFilePrinter.DefaultPrinterName = "Take printer";   
PdfFilePrinter printer = new PdfFilePrinter(@"C:\\temp.pdf");  
printer.Print();  

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM