Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a PDF with booklet-odered pages (like the one below). I would like to break these PDF A4 pages back into the original twice as many PDF A5 pages.

|-------| PDF page 1
| 8   1 |
|-------|

|-------| PDF page 2
| 2   7 |
|-------|

|-------| PDF page 3
| 6   3 |
|-------|

|-------| PDF page 4
| 4   5 |
|-------|
share|improve this question
2  
May be this thread in comp.text.tex could help you: Splitting 2 pages/page landscape postscript file into two single page portrait pages –  Ignasi Jul 10 '12 at 13:57

3 Answers 3

up vote 5 down vote accepted

Here's a solution via tikz and graphicx. Two compilations are required. gen.pdf is your booklet PDF file.

\documentclass[a5paper]{article}
\usepackage{geometry}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}
\foreach \page in {1,...,4}{
  \begin{tikzpicture}[overlay,remember picture]
    \ifodd\page
    \node at (current page)
    {\includegraphics[page=\page,trim=148.5mm 0 0 0]{gen.pdf}};
    \else
    \node at (current page)
    {\includegraphics[page=\page,trim=0 0 148.5mm 0]{gen.pdf}};
    \fi
  \end{tikzpicture}
  \newpage
}
\foreach \page in {4,...,1}{
  \begin{tikzpicture}[overlay,remember picture]
    \ifodd\page
    \node at (current page)
    {\includegraphics[page=\page,trim= 0 0 148.5mm 0]{gen.pdf}};
    \else
    \node at (current page)
    {\includegraphics[page=\page,trim= 148.5mm 0 0 0]{gen.pdf}};
    \fi
  \end{tikzpicture}
  \newpage
}
\end{document}
share|improve this answer
    
Thanks, after some tweaking it works for me. For the tweaks, see my CW answer. –  tohecz Jul 10 '12 at 20:56

Modification of the solution by PolGab, I got away the tikzpicture part which is completely unnecessary IMO, and I use tikz only for \foreach.

\documentclass[a5paper]{article}
\usepackage[margin=0pt]{geometry}
\usepackage{tikz}
\pagestyle{empty}
\def\placepage#1{%
\leavevmode\kern-0.25in{#1}%
}
\begin{document}
\foreach \page in {1,...,4}{
    \ifodd\page
    \placepage{\includegraphics[page=\page,trim=148.5mm 0 0 0]{y.pdf}}
    \else
    \placepage{\includegraphics[page=\page,trim=0 0 148.5mm 0]{y.pdf}}
    \fi
  \newpage
}
\foreach \page in {4,...,1}{
    \ifodd\page
    \placepage{\includegraphics[page=\page,trim= 0 0 148.5mm 0]{y.pdf}}
    \else
    \placepage{\includegraphics[page=\page,trim= 148.5mm 0 0 0]{y.pdf}}
    \fi
  \newpage
}
\end{document}
share|improve this answer
    
tikz is certainly not necessary... but it is convenient to properly position the elements. Are you sure that your A5 page contents are perfectly centered (vertically and horizontally) ? Why -0.25in ? –  Paul Gaborit Jul 11 '12 at 5:51
    
Instead of \usepackage{tikz} you could only use \usepackage{pgffor} which provides \foreach command without other TiKZ tools and commands. pgffor package is part of TiKZ. –  Ignasi Jul 11 '12 at 8:14
    
@PolGab sorry to say that, but your code gave me completely wrong placement. –  tohecz Jul 11 '12 at 21:59
1  
@tohecz A wrong placement is the result of the first compilation. With a second compilation, placement should be perfect. –  Paul Gaborit Jul 11 '12 at 22:22

... and here are detailed descriptions how you can do that with the help of Ghostscript:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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