How to make all pages in a PDF the same size

documentsghostscriptpdf

I have a pdf with different size pages. The first page is 579.275 by 402.547 points. The remaining pages are 612 by 792 pts (letter). I would like to have all the pages be letter size. The output from pdfinfo -box -f 1 -l 10 A.pdf is:

$ pdfinfo -box -f 1 -l 10 A.pdf 
Creator:        Toolkit http://www.activepdf.com
Producer:       Toolkit http://www.activepdf.com
CreationDate:   Sat Feb  4 18:42:49 2012
ModDate:        Sat Feb  4 18:42:49 2012
Tagged:         no
Form:           AcroForm
Pages:          5
Encrypted:      no
Page    1 size: 579.275 x 402.547 pts
Page    1 rot:  0
Page    2 size: 612 x 792 pts (letter)
Page    2 rot:  0
Page    3 size: 612 x 792 pts (letter)
Page    3 rot:  0
Page    4 size: 612 x 792 pts (letter)
Page    4 rot:  0
Page    5 size: 612 x 792 pts (letter)
Page    5 rot:  0
Page    1 MediaBox:     0.00     0.00   612.00   792.00
Page    1 CropBox:     15.05   374.40   594.33   776.94
Page    1 BleedBox:    15.05   374.40   594.33   776.94
Page    1 TrimBox:     15.05   374.40   594.33   776.94
Page    1 ArtBox:      15.05   374.40   594.33   776.94
Page    2 MediaBox:     0.00     0.00   612.00   792.00
Page    2 CropBox:      0.00     0.00   612.00   792.00
Page    2 BleedBox:     0.00     0.00   612.00   792.00
Page    2 TrimBox:      0.00     0.00   612.00   792.00
Page    2 ArtBox:       0.00     0.00   612.00   792.00
...
File size:      211688 bytes
Optimized:      no
PDF version:    1.3

I've attempted many variations of a ghostscript command with flags -sPAPERSIZE, -dFIXEDMEDIA, -dPDFFitPage. I cannot figure out how to get the first page to be letter. I do not care if the content of the first page is scaled up.

Question: How can I make all the pages the same size?

The reason for this question is that we have a new printer in the office. For reasons that I don't fully understand newer versions of CUPS or ghostscript cause the print server to crash. We have the ability to print from a USB storage device, but the printer will not accept documents with page sizes other than letter.

Best Answer

The output of your pdfinfo command clearly shows that all your pages have the same size: 612 x 792 pt ("MediaBox"), which is the 'letter' size.

However, page 1 is set to tell the PDF viewer (and the printer) to display only a part the page area ("CropBox").

If you remove the CropBox (as well as the Art-, Bleed- and TrimBox-es) settings in your PDF with a tool of your choice (even a text editor), or if you change them to the same values as the MediaBox, you'll have PDF viewers (and printers) show the full page content (even if the "rest" is only white margins). Note: it may happen that there is hidden content on your first page which becomes visible if you remove the Crop-, Trim-, Bleed- and ArtBoxes.

Related Question