[texhax] Splitting 2-up pages

Philip Taylor P.Taylor at Rhul.Ac.Uk
Mon Feb 25 16:46:47 CET 2019


> I have a PDF document “printed” 2-up, so that on each 11″×8½″ page there
> are two 5½″×8½″ pages I’d like to extract. How do I go about this?
>
> Is there a way to do this automatically for the entire book?

Maybe something along the lines of the following (replace "100" by the 
maximum page number)

\documentclass{minimal}

\usepackage[papersize={5.5in,8.5in}, margin=0pt, ignoreall]{geometry}

\setlength{\parindent}{0pt}

\usepackage{graphicx}

\begin{document}

\count 254 = 0

\loop

\includegraphics[viewport= 0 0 396 612, page=\count 254]{two-up.pdf}

\includegraphics[viewport= 396 0 792 612, page=\count 254]{two-up.pdf}

\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

\repeat

\end{document}

Philip Taylor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20190225/2619935f/attachment.html>


More information about the texhax mailing list