Shuffle PDF 2-up in shell I want to make a new pdf from my old one: put portrait pages 1 &amp; 2 on a landscape page 1, pages 3 &amp; 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.
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