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 am training to merge multiple files using ghostscript, nevertheless the problem arises because the pdf files are in different paper size.

So far, I've found this one command:

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf file1.pdf file2.pdf file3.pdf [...] lastfile.pdf

With same paper size it works, otherwise it does not.

Any suggestion are welcome?

Thanks for reading :)

share|improve this question

Do you want all pages in the resulting document to have the same paper size? For that, you would need to resize the page of one of the two documents. This question deals with resizing one PDF using ghostscript.

Otherwise, just leave out the -sPAPERSIZE switch, so your command will look like:

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf file1.pdf file2.pdf file3.pdf lastfile.pdf
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.