通过命令行以编程方式打印多份副本 [英] Programmatically print multiple copies from command line
问题描述
我的应用程序生成35至55个PDF文件,我必须自动打印四份.
My application generates between 35 and 55 PDF files of which I have to automatically print four copies.
所有这些文件都在一个文件夹中.
All these files are in a single folder.
我的要求是使用批处理文件来打印每个文件的四个副本.
My requirement is to use a batch file to print four copies of each file.
我已安装Adobe Acrobat Reader.
I have Adobe Acrobat Reader installed.
我该怎么做?
推荐答案
Adobe Reader仅能够直接打印单个副本.但是,没有什么可以阻止您循环和打印4次.但是,由于文档必须被发送到打印机四次,因此可能会花费更长的时间.
Adobe Reader is only capable of printing a single copy directly. However, nothing prevents you from looping and printing it 4 times. It may take longer, though, since the document has to be sent to the printer four times.
AcroRd32.exe /t path "printername" "drivername" "portname"
-启动Adobe Reader并在不显示打印"对话框的情况下打印文件.路径必须完全指定.
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.
/t
选项的四个参数的计算结果为path
,printername
,drivername
和portname
(所有字符串).
The four parameters of the /t
option evaluate to path
, printername
, drivername
, and portname
(all strings).
printername
—打印机的名称.
drivername
-打印机驱动程序的名称,显示在打印机属性中.
portname
-打印机的端口. portname
不能包含任何"/"字符;如果是这样,输出将路由到该打印机的默认端口.
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.
所以您可能可以使用类似这样的东西:
So you can probably use something like this:
for %%F in (*.pdf) do (
for /L %%i in (1,1,4) do (
AcroRd32.exe /t "%%~fF" "printername" "drivername" "portname"
)
)
只需为缺少的参数插入适当的值即可.
Just insert the appropriate values for the missing arguments.
这篇关于通过命令行以编程方式打印多份副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!