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.
Asked
Active
Viewed 4,023 times
6
H.v.M.
- 303
-
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 '17 at 01: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 '17 at 01:55
-
Does this answer help in any manner? I tried various options, including noautoscale, offset, with pdfpages, no luck. – Masroor Jan 31 '17 at 02:08
-
It's in the manual; see my answer below. – JPi Jan 31 '17 at 02:13
1 Answers
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}
JPi
- 13,595
-
1That 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 '17 at 02: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 '17 at 02:29
-
1No, it does not work with multiple pages. Each page gets shifted to bottom with empty spaces at the top. – Masroor Jan 31 '17 at 02:34
-
-
1Nice! I'd like to add that for longer pdfs, this works:
\foreach \x in {1,...,167}– H.v.M. Jan 31 '17 at 03:45