打印pdf的多个副本

我目前正在使用以下代码使用Foxit Reader软件打印pdf。 现在我的问题是我想要打印文件的多个副本。 任何人都可以让我知道如何在下面的代码中打印pdf时指定副本数量。

[编辑]我不想使用循环来打印pdf的多个副本。 我想仅将其指定为命令行参数。

任何帮助非常感谢:)

Process process = new System.Diagnostics.Process(); process.EnableRaisingEvents = false; process.StartInfo.CreateNoWindow = true; process.StartInfo.FileName = foxitReaderInstalledPath; string arguments = String.Format(@"-t ""{0}"" ""{1}""", this.Path, printerName); process.StartInfo.Arguments = arguments; process.Start(); process.WaitForExit(); 

根据Foxit手册,没有选择做你想要的,除了一个循环(你不想使用)。

您可以使用一些用于.NET的PDF库 – 那里有很多免费和商业的(参见例如.NET库来打印PDF文件 ) – 或者您使用例如Acrobat reader进行打印(IIRC它有一个命令行开关来实现你想要什么)…

把它放在一个循环中。 您可以随时操纵终止该过程。 把它放在参数中会很好,但我不认为FoxIt支持我所知道的。

 int numberOfCopies = 2; Process process = new System.Diagnostics.Process(); for (int i = 1; i <= numberOfCopies; i++) { process.EnableRaisingEvents = false; process.StartInfo.CreateNoWindow = true; process.StartInfo.FileName = foxitReaderInstalledPath; string arguments = String.Format(@"-t ""{0}"" ""{1}""", this.Path, printerName); process.StartInfo.Arguments = arguments; process.Start(); }