I want to make a new pdf from my old one: put portrait pages 1 & 2 on a landscape page 1, pages 3 & 4 on page 2, and so on.

Preview.app does this, but I need to do it in the shell.

jPDFtweak.jar also does this in GUI, but for no reason it fails to do it in terminal (for some of my files).

I do not know, how to use lp to print to pdf.

  • You might want to take a look at Coherent's command line PDFs tools. – IconDaemon Jun 29 '16 at 9:39

Thanks to @IconDaemon, the solution is like this:

cpdf -twoup-stack my-file.pdf -o out.pdf
cpdf -rotate 90 out.pdf -o out2.pdf
cpdf -scale-to-fit "210mm 297mm" out2.pdf -o my-file-collated.pdf
rm out.pdf out2.pdf

You must log in to answer this question.

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