从命令行编程打印多个副本 [英] Programatically print multiple copies from command line

查看:630
本文介绍了从命令行编程打印多个副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程式产生35到55个PDF档案,其中我必须自动列印四份。



所有这些档案都位于单一资料夹中。



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



我安装了Adobe Acrobat Reader。 / p>

如何操作?

解决方案

Adob​​e Reader直接打印单个副本。然而,没有什么阻止你循环和打印它4次。可能需要更长时间,因为文档必须发送到打印机四次。



Acrobat SDK开发人员常见问题


AcroRd32.exe / t路径printernamedrivernameportname - 启动Adobe Reader并打印文件,同时抑制打印对话框。路径必须完全指定。



/ t 选项的四个参数计算为 path printername drivername portname (所有字符串)。



printername - 打印机的名称。

drivername - 打印机驱动程序的名称,如打印机属性中所示。

portname - 打印机的端口。 portname 不能包含任何/字符;


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

  for(* .pdf)do(
for / L %% i in )do(
AcroRd32.exe / t%%〜fFprinternamedrivernameportname


pre>

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


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.

I have Adobe Acrobat Reader installed.

How do I do this?

解决方案

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.

From the 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.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆