I'm trying to resize a PDF document with large dimensions to A4 format with 2cm borders on each size.
This is what I managed to get so far
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -sOutputFile=output.pdf input.pdf
The problem is that even though it scales down to A4, it adds a border on left/right side. I'd like to add a border (2cm) on each of the sides (top/bottom/left/right).
I tried to search everywhere Resize A4 PDF to SRA4 and center content
Using -c "<</PageOffset [21 32]>> setpagedevice"
gives me **** Unable to open the initial device, quitting.
. Do you know what am I doing wrong? Or how could I get A4 PDF document with 2cm borders?
Thank you