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}
Result
Page 1 of the compiled examplePage 1
Page 2 of the compiled examplePage 2

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}
Result
The compiled example

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}
Result
The compiled example

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}
Result
The compiled example

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages