7

I want to include an external PDF in my document. The PDF looks like this (except not redacted). As you can see, the last page is smaller than the others. Using \includepdf with pdfpages, the last page's content has been centered on a normal size page. I want the pages to appear in the document as they are in the pdf.

4
  • So you want the page sizes in your latex document to be the same as in the external pdf, correct? This can be done, but it would take me a while to figure out how.
    – JPi
    Jan 31, 2017 at 1:47
  • @JPi Yeah so let's say the external PDF is included as pages 5-7 in the latex document. Then I want page 5 to be identical - including page size - to external page 1, page 6 identical to external page 2, page 7 identical to external page 3. And naturally the rest of the document pages should be unaffected by the external PDF. Thanks in advance!
    – H.v.M.
    Jan 31, 2017 at 1:55
  • Does this answer help in any manner? I tried various options, including noautoscale, offset, with pdfpages, no luck.
    – Masroor
    Jan 31, 2017 at 2:08
  • It's in the manual; see my answer below.
    – JPi
    Jan 31, 2017 at 2:13

1 Answer 1

8
\documentclass{article}

\usepackage{pdfpages}


\begin{document}

\includepdf[page=1,fitpaper]{mooi}
\includepdf[page=2,fitpaper]{mooi}
\end{document}

EDIT

\documentclass{article}

\usepackage{pdfpages}
\usepackage{pgffor}

\begin{document}
\foreach \x in {1,2}
 {\includepdf[page=\x,fitpaper]{mooi}}
\end{document}
5
  • 1
    That means you need include one page at a time. Is there any way to do this automatically while you include the whole document in one go?
    – Masroor
    Jan 31, 2017 at 2:16
  • I haven't tried with multiple pages. Try it. If that doesn't work then you can just use a for loop.
    – JPi
    Jan 31, 2017 at 2:29
  • 1
    No, it does not work with multiple pages. Each page gets shifted to bottom with empty spaces at the top.
    – Masroor
    Jan 31, 2017 at 2:34
  • edited, see above
    – JPi
    Jan 31, 2017 at 2:44
  • 1
    Nice! I'd like to add that for longer pdfs, this works: \foreach \x in {1,...,167}
    – H.v.M.
    Jan 31, 2017 at 3:45

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.