windows - 从命令行以编程方式打印多份副本

标签 windows batch-file pdf printing cmd

我的应用程序生成 35 到 55 个 PDF 文件,我必须自动打印其中四份副本。

所有这些文件都位于一个文件夹中。

我的要求是使用批处理文件打印每个文件的四份副本。

我安装了 Adob​​e Acrobat Reader。

我该怎么做?

最佳答案

Adobe Reader 只能直接打印一份副本。但是,没有什么可以阻止您循环打印 4 次。但可能需要更长的时间,因为文档必须发送到打印机四次。

来自Acrobat SDK Developer FAQ :

AcroRd32.exe /t path "printername" "drivername" "portname" — Start Adobe Reader and print a file while suppressing the Print dialog box. The path must be fully specified.

The four parameters of the /t option evaluate to path, printername, drivername, and portname (all strings).

printername — The name of your printer.
drivername — Your printer driver’s name, as it appears in your printer’s properties.
portname — The printer’s port. portname cannot contain any "/" characters; if it does, output is routed to the default port for that printer.

所以你可能可以使用这样的东西:

for %%F in (*.pdf) do (
  for /L %%i in (1,1,4) do (
    AcroRd32.exe /t "%%~fF" "printername" "drivername" "portname"
  )
)

只需为缺少的参数插入适当的值即可。

关于windows - 从命令行以编程方式打印多份副本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3462388/

相关文章:

windows - 如何在 CComboBox 控件中正确使用 DDX(数据交换)?

r - 以编程方式加载文件

windows-7 - 如何在批处理文件中以管理员权限启动程序

javascript - 我可以使用 iText 创建 pdf 中不需要的字段吗?

linux - Linux 上命令行将 PDF 转换为 PDF/A? Ghostscript 的注释问题

windows - 如何让 wget 在网页索引文件的工作本地副本中包含日期和时间戳

c# - C#mp3压缩64位

mysql - 使用批处理脚本在Windows上安装mysql服务器

windows - 在 setenv.bat 中为 tomcat 7 windows 安装(作为服务)编写 set JAVA_OPTS 的位置

java - Jasper Report - 在 PDF 文档中设置作者属性