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.
-
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.– JPiJan 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.– MasroorJan 31, 2017 at 2:08
-
It's in the manual; see my answer below.– JPiJan 31, 2017 at 2:13
1 Answer
\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}
-
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?– MasroorJan 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.– JPiJan 31, 2017 at 2:29
-
1No, it does not work with multiple pages. Each page gets shifted to bottom with empty spaces at the top.– MasroorJan 31, 2017 at 2:34
-
-
1Nice! 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