Can I use K2pdfopt to take a PDF, crop it to the tightest bounding box, and generate a new PDF with 2 consecutive (portrait) pages set side-by-side on the same (landscape) page such that they are scaled to maximally fill an A4 page (preserving aspect ratio)?

If so, what command line options will allow me to achieve this?

By removing margins and such re-scaling I can save a lot of paper when I need to print a document.

  • 2
    You might want to contact the k2pdfopt developer. He usually replies quickly with custom command line options. – user4665 Mar 3 '18 at 6:19
  • @willus? Any suggestions? – Adi Shavit Mar 3 '18 at 15:17

This is commonly called "2-up" page placement, and, no, k2pdfopt cannot do 2-up page placement by itself. Sorry. But you can run k2pdfopt in "fit-width" mode with the width and height of the output page set for normal portrait like so:

k2pdfopt -ds 2 -w 8.5in -h 11in -mode fw -ls- ...

This will strip the margins and create 8.5x11-inch pages. (The -ds 2 scales up the source document so it will fit the full width of a portrait page.) Then you can use CutePDF's print-to-PDF driver (free download) to print that 8.5x11-inch PDF 2-up by selecting 2 pages per sheet in the printer preferences.

Or you can use Coherent PDF's command-line tool (free for personal use). In this case, I use cpdf's -twoup-stack option, so I want the k2pdfopt output pages to be exactly half the size of an 11x8.5 page.

k2pdfopt -w 5.5in -h 8.5in -mode fw -ls- myfile.pdf
cpdf -twoup-stack myfile_k2opt.pdf -o temp.pdf
cpdf -rotate 90 temp.pdf -o final.pdf

Examples here.

| improve this answer | |
  • This almost works. What would be nice is if all the pages were cropped to the same box or scale factor. When I have a last page with only e.g. a single column this gets blown up and spread over 2 pages. – Adi Shavit Mar 5 '18 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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