打印多份 pdf 副本

发布于 2024-12-04 11:06:13 字数 548 浏览 0 评论 0原文

我目前正在使用以下代码使用 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();

I am currently using the below code for printing a pdf using Foxit Reader software. Now my problem is I want to print multiple copies of a file. Could anyone let me know how to specify the number of copies while printing a pdf in the below code.

[Edit]
I dont want to use a loop to print multiple copies of pdf. I want to specify it only as a command line argument.

Any help much appreciated :)

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萌辣 2024-12-11 11:06:13

根据 Foxit 手册,除了使用循环(您不想使用循环)之外,没有其他选项可以执行您想要的操作。

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

According to the Foxit manual there is no option to do what you want except with a loop (which you don't want to use).

Either you use some PDF library for .NET -there are plenty free and commercial ones out there (see for example .NET library to print PDF files )- or you use for example Acrobat reader for printing (IIRC it has a commandline switch to achieve what you want)...

别靠近我心 2024-12-11 11:06:13

只需将其放入循环即可。您以后随时可以操纵该进程的终止。
最好将它放在参数中,但据我所知,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();
    }

Just put that in a loop. You can always manipulate the termination of the process later.
It'd be nice to put it in the Arguments, but I don't think FoxIt supports it that I know of.

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();
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文