Booklets on legalpaper using pdfpages

I want to make a signature for a small pocket booklet. I don't want to use ISO sized paper, but every reference to pdfpages uses A5 or A6 booklet examples. Is this possible to do? Do I need to produce a distinct PDF file for each page of the booklet? Should I be using a different package or documentclass to accomplish this, or should I be investing time in pdfpages? I'm a little overwhelmed by the documentation, and unsure about how to proceed.

I used the example from this website:

http://www.mostlymaths.net/2010/11/creating-a6-booklets-in-7-easy-steps.html

File 1 (thedocument.pdf):

\documentclass{memoir}
\usepackage{lipsum}
\begin{document}
\lipsum[1-40]
\end{document}


File 2 (b2x1.pdf):

\documentclass[legalpaper]{article}
\usepackage[pdftex]{color,graphicx,epsfig}
\usepackage[left=2cm,top=2.cm,bottom=2.cm,right=2cm]{geometry}
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages=-, signature=80,landscape, frame=true]{thedocument.pdf}
\end{document}


File 3 (b4x1.pdf):

\documentclass[legalpaper]{article}
\usepackage[pdftex]{color,graphicx,epsfig}
\usepackage[left=2cm,top=2.cm,bottom=2.cm,right=2cm]{geometry}
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages=-, signature=40,landscape, frame=true]{b2x1.pdf}
\end{document}


File 4 (b8x1.pdf):

\documentclass[legalpaper]{article}
\usepackage[pdftex]{color,graphicx,epsfig}
\usepackage[left=2cm,top=2.cm,bottom=2.cm,right=2cm]{geometry}
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages=-, signature=20,landscape, frame=true]{b4x1.pdf}
\end{document}


I get a strange output. There's a very large margin on the left and right of the page, and there's only one page of the document showing up on each paper (instead of multiple pdfpages per paper).

Example:

• As always, a minimal working example (MWE) would be helpful. Perhaps you could show us the solution you'd like to use with ISO, and what problems you are running into when you try to adapt it to non-ISO. It is not obvious to me why that should be different? – cfr Jan 27 '15 at 1:39
• @cfr I'm sorry about that. I updated the post. – Nickolas Peter O'Malley Jan 27 '15 at 2:35

You can change the size using geometry

\documentclass{article}
\usepackage{pdfpages}
\usepackage[paperheight=7.5in,paperwidth=5in]{geometry}
\begin{document}
\pagestyle{empty}
\includepdf[pages=1-8, signature=8,landscape]{pgfmanual}

\end{document}


Change the paper size suitably (as you wish) in

\usepackage[paperheight=7.5in,paperwidth=5in]{geometry}


Edit:

In the thedocument.tex you have to choose the paper width to be (at most) half of the legal papers height, i.e. 279.4mm. In this I have set the width to be 170mm

\begin{filecontents}{thedocument.tex}
\documentclass[twoside]{article}   %% changed
\usepackage[paperheight=215.9mm,paperwidth=170mm,top=2cm,bottom=2cm,inner=2cm,outer=1cm]{geometry}
\usepackage{lipsum}
\begin{document}
\lipsum[1-65]
\end{document}

\end{filecontents}

\documentclass[legalpaper]{article}
\usepackage[pdftex]{color,graphicx,epsfig}
\usepackage[margin=0cm]{geometry}
\usepackage[final]{pdfpages}
\immediate\write18{pdflatex thedocument}
\begin{document}
\includepdf[pages=-, signature=12,  landscape,frame=true]{thedocument.pdf}
\end{document}


• I'm going to give this a try. A quick question: does the paper height/width setting for geometry set the size for the individual pdfpages on a single page, or for the entire piece of paper that the pdfpages are on? – Nickolas Peter O'Malley Jan 27 '15 at 2:40
• Using geometry like this didn't work. It only changed the size of the physical page I'm printing on. It didn't make any difference if I kept the original geometry setting on the final b8x1 page. – Nickolas Peter O'Malley Jan 27 '15 at 2:47
• @NickolasPeterO'Malley pdfpages will automatically scale the contents to the paper size, so theoretically if you choose preoper physical paper size this should work. – user11232 Jan 27 '15 at 2:57
• @NickolasPeterO'Malley Remove left=2cm,top=2.cm,bottom=2.cm,right=2cm, you won't need it in b2x1 document. Put it in thedocument instead. Also the final pagenumber and the signatures should be same as in pages=1-40,signature=40,. – user11232 Jan 27 '15 at 3:09
• @NickolasPeterO'Malley Now I gotta go. I will see later on today. – user11232 Jan 27 '15 at 3:13