Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering how to change width and height of each page of a pdf?

In my scanned pdf, each page has paper size too big, 31.98 × 49.20 inch. I would like to shrink the width and height to smaller ones which are normally seen in pdf files.

Are there some applications or programming tools to accomplish this?

share|improve this question
up vote 3 down vote accepted

You could try ghostscript (all one line):

gs -sOutputFile=output.pdf -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -f input.pdf

Change a4 to letter for North America.

share|improve this answer
(I fixed an earlier, worse answer.) – frabjous Aug 8 '11 at 4:00
Thanks! It reduces the width and height. But why the storage size increases almost three times from 7.4M to 22M? – Tim Aug 8 '11 at 4:14
It converts it to PostScript and back, but why that should increase file size so dramatically, I don't know. You probably also go from PDF version 1.5+ to 1.4, which may have something to do with it. – frabjous Aug 8 '11 at 4:21
Ghostscript may have to rasterize stuff PS does not support. For simple PDFs, this works nicely. Still looking for a solution that is PDF-only. – Raphael Jun 3 '13 at 17:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.