Forum moved here!

Home / Printing page multiple copies from command line

crobusa

Hi there,

Thanks for the awesome software! I’m using Windows 10 Pro, with the Microsoft PDF-printer driver for testing.
test.pdf is a 85 page test file used as input.

I’ve read the documentation, and it says "-print-settings “3x” : prints the document 3 times"
I’m trying to print the 11th page of the PDF file 5 times

The command line I’m trying to use is:
SumatraPDF.exe C:\tmp\test.pdf -print-to-default -print-settings “5x”,11
SumatraPDF.exe C:\tmp\test.pdf -print-to-default -print-settings "5x"
SumatraPDF.exe C:\tmp\test.pdf -print-to-default -print-settings 5x

All of the above generate a 85 page PDF file to the Microsoft PDF printer driver.
I was expecting a 5 page file for attempt 1, and 425 file for attempts 2 and 3.

I thought it could be that the command line was unixy and I need to somehow escape the double quotes in windows cmd in the examples. but an hour of banging my head against the wall seems not to have yielding much except a headache.

Thanks!

crobusa

As a workaround, I had the number of copies I needed in a google sheet, in column B.

  • Concatenated the needed command for a single copy of page 11, followed by a newline (-print-settings 11,CHAR(10))
  • Used the rept function to repeat the concatenated line (rept(A1,B1)
  • Copied column C into Word*, cleared formatting, and copied and pasted into notepad.

*Somehow Notepad++ and Notepad really didn’t like the mixture of double quotes, newlines, and tables being copied over, and this was a quick and dirty solution

GitHubRulesOK

Sometimes SumatrPDF print syntax works better when in this order

SumatraPDF.exe -print-to-default -print-settings "5x",11 C:\tmp\test.pdf

I note from your cut / paste you are using multiple types of quote marks

ensure you save from notepad as “plain text” and putting a pause as the last line will allow you to see what is run, so what I see it is

SumatraPDF.exe C:\tmp\test.pdf -print-to-default -print-settings ô5xö,11
pause
Press any key to continue . . .