Change PDF page size without re-scaling a content (CLI)
3
votes
1
answer
2445
views
## Question
I have a PDF with a non-standard page size.
I would like to change PDF canvas size to A4 without re-scaling the content.
I can receive the expected result with Printing to PDF (picture below, original content is a black rectangle). However, I would like to achieve the same result using Linux CLI.
How can I change PDF page size **without** rescaling the content, using the Linux command line?
## Investigation
I have tried to use pdfjam:

pdfjam --outfile out.pdf --paper a4paper in.pdf
. Unfortunately, it scales to fit in.pdf
and thats unacceptable for me.
Also I tried cpdf: cpdf -scale-page a4portrait in.pdf -o out.pdf
scales content to the page size.
Moreover, found PdfScale . However it can only scale content or change page size with fitting the content.
The similar problem has been described here , but the author used GUI application (not CLI)
Asked by Toliak
(131 rep)
Nov 14, 2021, 07:10 PM
Last activity: May 29, 2025, 03:04 AM
Last activity: May 29, 2025, 03:04 AM