簡體   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