我的应用程序生成 35 到 55 个 PDF 文件,我必须自动打印其中四份副本。
所有这些文件都位于一个文件夹中。
我的要求是使用批处理文件打印每个文件的四份副本。
我安装了 Adobe Acrobat Reader。
我该怎么做?
最佳答案
Adobe Reader 只能直接打印一份副本。但是,没有什么可以阻止您循环打印 4 次。但可能需要更长的时间,因为文档必须发送到打印机四次。
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 topath
,printername
,drivername
, andportname
(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/