2

Assume I have two PDFs that I want to stitch together. Both have the same width (standard A4), but one of them is much higher (page height adjusted by using the geometry package).

Now, when I include the bigger PDF within the smaller, it gets either rescaled or cropped, depending on whether I have rescaling turned on in the pdfpages command. I want neither of this to happen – I simply want to have them stitched together in their original dimensions. How do I do this?

Small.tex (and Small.pdf)

\documentclass{article}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{pdfpages}

\begin{document}
Page \#1 of small document.
\newpage
\includepdf[noautoscale]{Big.pdf}
\end{document}

Big.tex (and Big.pdf)

\documentclass{article}
\usepackage[a4paper, paperheight=30in, margin=1in]{geometry}
\usepackage{blindtext}

\begin{document}
Page \#1 of big document.\\

\blindtext[20]
\end{document}
  • Most probably you need \newgeometry command (geometry) package to resize the margins etc. for the larger one. – user31729 Mar 22 '15 at 10:55
  • I treid \newgeometry{paperheight=20in} before \includepdf, but it didn't help. The included PDF either gets rescaled to standard A4 dimensions (the dimensions of my original document), or cropped if noautoscale is used. – d125q Mar 22 '15 at 11:19
  • You should show us how the separate files are generated and how you want to combine them. – user31729 Mar 22 '15 at 11:24
  • You are not expecting a 30in paperheight document fitting into A4 format height (which is about 30cm, or 12in), are you? – user31729 Mar 22 '15 at 11:37
  • I am not. I am expecting to have the two stitched together, i.e. one page of A4, then the big one, then again A4. – d125q Mar 22 '15 at 11:38
8

The pdfpages provides an options to do just that which is switched off by default:

fitpaper Adjusts the paper size to the one of the inserted document. Either 'true' or 'false' (or no value, which is equivalent to 'true'). (Default: fitpaper=false)

So in your original Small.tex, replacing the noautoscale option with fitpaper=true, will what you are asking:

\documentclass{article}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{pdfpages}

\begin{document}
Page \#1 of small document.
\newpage
\includepdf[fitpaper=true]{Big.pdf}
\end{document}

screenshot with Adobe Reader

  • Thanks! I should have looked at the docs more carefully. – d125q Mar 22 '15 at 15:51
2

here is a solution using typearea package

\documentclass{article}
\usepackage[a4paper,pagesize]{typearea}
\usepackage{pdfpages}

\begin{document}
Page \#1 of small document.
\newpage
\KOMAoptions{paper=21cm:30in,pagesize}
\includepdf[noautoscale]{Big.pdf}
\newpage
\KOMAoptions{paper=a4,pagesize}
\end{document}

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.