Forum moved here!

Home / Silent Print - page size

nckthmp

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

GitHubRulesOK

Labels can sometimes be a problem for command line printing

LATER EDIT FOR THOSE LOOKING FOR A SIMILAR ANSWER
Command line paper sizes have been significantly updated in current daily build, built on 2020-11-23, and later pre-releases for more details see

As a consequence the following is no longer correct

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.

nckthmp

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

GitHubRulesOK

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.