Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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'd like to be able to resize an A4 PDF to the slightly bigger SRA4 format, used by printing professionals. The content shouldn't be resized, but only centered. In other words, I'd like to add margins to my A4 document.

I managed more or less to do that with this Ghostscript (9.05) call:

gs -dPDFSETTINGS=/default -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite 

The problem is that the A4 content is not centered in the SRA4 page, but is placed at the bottom left corner.

Any idea how to center the content?

share|improve this question

I found a solution, by using -c "<</PageOffset [21 32]>> setpagedevice", like so:

gs -dPDFSETTINGS=/default -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite 
-dFIXEDMEDIA -c "<</PageOffset [21 32]>> setpagedevice" -f in.pdf

Content is perfectly centered in the SRA4 document.

share|improve this answer

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.