Include PDF pages in LaTeX (pdfpages, includepdf)
\includepdf[pages=-]{file.pdf} from the pdfpages package inserts all pages of a PDF file as full pages of your document. Without pages, only the first page is inserted.
Preamble
The snippets on this page need these lines before \begin{document}:
\usepackage{pdfpages}Insert a whole PDF
pages=- stands for all pages. Each inserted page fills a page of your document; your margins, header and page number do not appear on it.
Text before the inserted pages.
\includepdf[pages=-]{figure.pdf}Insert selected pages
pages takes single pages and ranges, separated by commas: {1,3-5} inserts pages 1, 3, 4 and 5. 2- runs from page 2 to the end, and last-1 inserts all pages in reverse order.
\includepdf[pages={1,3-5}]{report.pdf}Keep header and page number
pagecommand={} keeps the page style of your document, so header, footer and page number are printed over the inserted page. scale=0.85 shrinks the inserted page to make room for them.
\includepdf[pages=-,pagecommand={},scale=0.85]{figure.pdf}Put several pages on one sheet
nup=2x2 arranges the inserted pages in two columns and two rows per page of your document. frame draws a border around each of them.
\includepdf[pages=-,nup=2x2,frame]{figure.pdf}Insert a PDF page as a figure
For a PDF page inside the text, with caption and number, use \includegraphics. Its page key selects the page. pdfpages loads graphicx, so no further package is needed.
\begin{figure}
\centering
\includegraphics[page=1,width=0.6\textwidth]{figure.pdf}
\caption{The first page of the report}
\end{figure}Pitfalls
\includepdfalways starts a new page. The text before it ends on the previous page, even if that page is half empty.- Links, bookmarks and form fields of the inserted PDF are lost; only the visible page content is copied.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- Package
pdfpages - Package
graphicx - How-to Insert an image in LaTeX
- How-to Add an appendix in LaTeX
- How-to Rotate a single page to landscape in LaTeX