I am trying to scale a PDF which is for example just small of A4 size up to A4.
This works fine with portrait documents. The document is scaled up correctly and then padding is added to the top.
On landscape documents padding is not added though. Therefor the document will end up being the correct height for A4 but then not wide enough, as padding is not added on the document side (as I hoped).
This is what I use to have it working for A4 portrait documents:
gs
-sOutputFile=output.pdf
-sDEVICE=pdfwrite
-sPAPERSIZE=a4
-dCompatibilityLevel=1.4
-dNOPAUSE
-dBATCH
-dPDFFitPage
input.pdf
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…