Programmatically print multiple copies from command line

后端 未结 2 502
情话喂你
情话喂你 2021-01-21 14:33

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 i

2条回答
  •  一个人的身影
    2021-01-21 15:05

    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.

提交回复
热议问题