Silent Print - page size


#1

Hi All,
I am automating the printing of a pdf (or several pdfs) with a batch file.
Start SumatraPDF.exe -print-to “CitizenLabels” “Y:\123.pdf”
when the “labels” print out they aren’t the correct size. If I open the pdf with adobe and print to the same printer the labels are fine.
Thanks
Nick


#2

Labels can sometimes be a problem for command line printing

SumatraPDF command line can accept “paper=A6”, “paper=A5” size and “noscale” , “shrink” and “fit” also recently “portrait”
(see https://www.sumatrapdfreader.org/docs/Command-line-arguments.html)

The problem is that labels are a custom size and by default if A6 is not small enough the system default printer page size is used (normally letter or A4) this causes complaints when fit or shrink move the label to one side or even out of print area.

One way round this is to ensure that prior to printing the windows system default is set to the label size then reset to A4 after printing.

Its not ideal and there is a long standing open issue on GitHub, however it is partly down to the way windows offers its print settings and some users have been able to work with that by switching parameters via scripting.


#3

Thank you.
Any advise on how to do that?
Thanks
Nick


#4

Find default printer or set your target printer as default
Set default page size as label size, ensure that is saved for default setting at system start up.
Run test prints with shrink or fit or noscale to find best results, with luck one is exactly what you need

There are supposedly ways to force the settings through registry but I have never needed to try that I just switch default printers manually.