A couple of years ago, someone posted (https://tex.stackexchange.com/a/53366/2966) claiming

After scanning a book 2-up, you can use pdfpages and ifthen to split the pages in two and reassemble 1-up.

I have a PDF document “printed” 2-up, so that on each ANSI-A (8½″×11″) page there are two 5½″×8½″ pages I’d like to extract. How do I go about this?

I can do this manually by writing

  margin=0pt, ignoreall,
\includegraphics[viewport= 0 0 396 612, page=1]{two-up.pdf}
\includegraphics[viewport= 396 0 792 612, page=1]{two-up.pdf}
\includegraphics[viewport= 0 0 396 612, page=2]{two-up.pdf}
\includegraphics[viewport= 396 0 792 612, page=2]{two-up.pdf}
% etc.

but this is repetitive and error-prone. Is there a way to do this automatically for the entire book?

  • 1
    You can achieve this using the viewport option of the includegraphics command of the graphicx package. – JPi Feb 24 '19 at 10:54

A loop is all that was needed, and the loop can even be initialized with the number of pages in the source document:

% …
\count 254 = 1
  \includegraphics[viewport= 0 0 396 612, page=\count 254]{two-up.pdf}
  \includegraphics[viewport= 396 0 792 612, page=\count 254]{two-up.pdf}
\ifnum \count 254 < 100 %%% maximum page number
   \advance \count 254 by 1

Thank you to Philip Taylor on the TeXhax mailing list.

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.