I got a PDF file for which I want to change its pages' sizes; let's call it file.pdf. And I got another PDF file which will serve as the model to file.pdf; let's call it model.pdf.

To clarify: I want file.pdf's pages to be of equal measure as model.pdf's pages.

Using pdfinfo on model.pdf I get the following relevant info:

Tagged:         no
Form:           none
Pages:          22
Encrypted:      no
Page size:      612 x 783 pts
Page rot:       0
MediaBox:           0.00     0.00   720.00   891.00
CropBox:           54.00    54.00   666.00   837.00
BleedBox:          54.00    54.00   666.00   837.00
TrimBox:           54.00    54.00   666.00   837.00
ArtBox:            54.00    54.00   666.00   837.00
File size:      3324788 bytes
Optimized:      no
PDF version:    1.7

I don't really understand what the first two columns of the *Box fields mean, but doing some Googling I got to the conclusion that my target are the last two columns of the MediaBox field. So, I want file.pdf to be 720x891, and I think the units are pts.

So I found this tool called pdfposter which is supposed to be able to change the size of a PDF's pages, and I did this (noteice I already made the conversion from points to inches):

pdfposter -m10x12.375inch file.pdf new_file.pdf

Everything goes well, but when I check new_file.pdf with pdfinfo I get:

Tagged:         no
Form:           none
Pages:          32
Encrypted:      no
Page size:      630.22 x 891 pts
Page rot:       0
MediaBox:          54.33    32.60   774.33   923.60
CropBox:           54.33    32.60   684.55   923.60
BleedBox:          54.33    32.60   684.55   923.60
TrimBox:           54.33    32.60   630.22   891.00
ArtBox:            54.33    32.60   630.22   891.00
File size:      3005203 bytes
Optimized:      no
PDF version:    1.3

Clearly something went wrong since the size of the new PDF's pages is 774.33x923.60 and not 720x891; moreover, the first two columns of the MediaBox changed from 0.00 0.00 to 54.33 32.60 and I got no idea why or what it means.

I also tried using pdfjam but it just adds more white space to the borders, while leaving the content of the PDF untouched.

So my question is: how can I change the size of my file.pdf's pages to that of model.pdf.

Note: It is very important for me that the resized PDF be of the same quality as the original PDF.

  • 2
    I tested and had trouble with the answer below, but then found this one unix.stackexchange.com/a/185224/188451 which uses pdfjam, fantastic. Yes, is not exactly the same as what the OP here was asking but is a very good solution for that kind of issue.
    – cardamom
    Dec 4, 2019 at 10:24
  • 4 years later I find myself commenting on the same post, still resizing and merging pdfs from the terminal... Usually I don't need to resize, but this time, the following ghostscript command did the trick - stackoverflow.com/a/28455147/4288043
    – cardamom
    Jan 29, 2023 at 3:17

3 Answers 3


You can use pdfjam with the --papersize argument to set the output paper size. You may also need to use --scale and --offset if you want to do more than resize the page and its contents together.

pdfjam --papersize="$(LC_ALL=C pdfinfo model.pdf | LC_ALL=C awk '/^Page size:/ {printf "{%fbp,%fbp}", $3, $5}')" file.pdf new_file.pdf
  • 1
    Beware that the --papersize format, "{XXu,YYu}", is quite strict : single or double quotes, braces, comma and units are all mandatory. Apr 13, 2018 at 9:53
  • 4
    This is the command that worked for me: pdfjam --papersize '{8.3in,11.7in}' Input.pdf --outfile Output.pdf -- A4 page size
    – Shayan
    Oct 26, 2021 at 14:02

You could try using ghostscript, which has a zillion options, including settings the output size in points:

gs -o output.pdf -sDEVICE=pdfwrite -dFIXEDMEDIA -dPDFFitPage \
    -dSAFER file.pdf

Not sure if you want -dPDFFitPage or not, but you can try it both with and without.


ps2pdf with ebook-settings had very good results for me, e.g. reducing a pdf from an image scan from 3 MB to 150 kB.

ps2pdf -dPDFSETTINGS=/ebook input.pdf output.pdf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .