How to Insert a PDF into LaTeX (pdfpages and includegraphics)

Updated Tested on TeX Live 2025 (pdfLaTeX), Oct 2026 5 min read

Quick answer

To insert a PDF into LaTeX, load pdfpages with \usepackage{pdfpages} and use \includepdf[pages=-]{file.pdf} to insert every page as a full page; pages={1-3} takes a range. To place one PDF page as a figure inside your text, use \includegraphics[page=2,width=\textwidth]{file.pdf} from the graphicx package.

LaTeX can treat a PDF either as whole pages to drop into the document or as an image to place inside a page. Pick the package by which of those you need.

Methods covered:

Insert full PDF pages with pdfpages

Use this when you want the PDF’s pages to become pages of your document, such as an appendix, a signed form or a published paper.

  1. Add the package to the preamble:

    \usepackage{pdfpages}
  2. Insert the PDF where its pages should appear, outside any figure or paragraph:

    \includepdf[pages=-]{path/to/your/file.pdf}
  3. Change pages to choose what goes in:

    • pages=- inserts every page.
    • pages={1-3} inserts a range.
    • pages={1,3,5} inserts single pages.
    • pages={3-} inserts page 3 to the end.

Result: each selected page appears as a full page, scaled to fit your paper size.

pdfpages ships with TeX Live, MiKTeX and Overleaf, and works with pdfLaTeX, XeLaTeX and LuaLaTeX.

Useful pdfpages options

Combine options with commas inside the square brackets, for example \includepdf[pages=-, nup=2x2, frame]{file.pdf}.

OptionWhat it does
pages=Which pages to insert (-, {1-3}, {1,3,5})
scale=0.8Shrinks each page to 80%
nup=2x2Puts 2 × 2 pages on each sheet (nup=1x2 for two)
landscapePlaces the output on a landscape sheet
angle=90Rotates the inserted page
fitpaperMakes the output sheet the same size as the PDF page
frameDraws a frame around each inserted page (useful with nup)
pagecommand={\thispagestyle{plain}}Keeps your page numbers on inserted pages
addtotoc={1,section,1,Appendix A,appA}Adds a table of contents entry pointing to page 1

Example: insert an appendix with page numbers and a contents entry.

\includepdf[pages=-,
pagecommand={\thispagestyle{plain}},
addtotoc={1,section,1,Appendix A: Survey form,appA}]{survey.pdf}

For all options, see the pdfpages package on CTAN and its manual.

Insert one PDF page as a figure with graphicx

Use this when a page of a PDF, such as a chart exported from another tool, should sit inside your text with a caption. graphicx treats a PDF like any other image.

  1. Load graphicx in the preamble with \usepackage{graphicx}.

  2. Put the PDF in a figure and set its width:

    \begin{figure}[htbp]
    \centering
    \includegraphics[page=2, width=0.8\textwidth]{report.pdf}
    \caption{Page 2 of the report.}
    \label{fig:report-p2}
    \end{figure}
  3. Leave out page= to use the first page.

Result: page 2 of the PDF appears as a numbered figure, scaled to 80% of the text width.

Other \includegraphics options work here too. For example, trim=2cm 2cm 2cm 2cm, clip crops the page margins away. For sizing and placement in depth, see how to insert JPG and PNG images; the same options apply to PDF pages.

Tip: For a chart or diagram, export it as a PDF rather than a JPG or PNG. Vector PDFs stay sharp at any size.

Attach a PDF file instead of showing it

Use this when readers should be able to open the original PDF from your document, but its pages shouldn’t appear in the layout.

  • attachfile adds a clickable icon or text link:

    \usepackage{attachfile} % in the preamble
    Here is the attached document: \attachfile{file.pdf}
    \textattachfile{file.pdf}{Download the original PDF}
  • embedfile attaches the file to the PDF as a whole, with no icon in the text:

    \usepackage{embedfile} % in the preamble
    \embedfile{file.pdf}

Note: Attachments depend on the PDF viewer. Adobe Acrobat Reader shows them; many browser viewers and simpler readers ignore them. Don’t rely on an attachment for content every reader needs.

Packages such as media9, which older guides suggest, embed video, audio and 3D content. They can’t display a PDF inside your document, so use pdfpages or graphicx instead.

Which method should you use?

MethodBest forShows pages in the layoutPackage
\includepdfWhole pages: appendices, forms, papersYes, as full pagespdfpages
\includegraphicsOne page as a figure with a captionYes, inside a pagegraphicx
\attachfileA clickable link to the original fileNoattachfile
\embedfileBundling the source file with your PDFNoembedfile

Insert a PDF in Overleaf

The commands are the same in Overleaf. Upload the PDF to the project (the upload button in the file tree, or drag and drop), then reference it by its file name or folder path. Recompile to see the pages.

Common errors

  • “File ‘file.pdf’ not found”: check the path, the spelling and the letter case. Overleaf and Linux are case-sensitive.
  • Page numbers disappear on inserted pages: add pagecommand={\thispagestyle{plain}}.
  • The inserted page is tiny or has wide margins: the PDF page size differs from yours. Try fitpaper, or scale= for finer control.
  • \includepdf inside a figure or mid-paragraph behaves oddly: \includepdf produces whole pages. Use \includegraphics for anything that should sit inside a page.
  • A warning about the PDF version being newer than allowed: usually harmless; the page still appears. Updating your TeX distribution normally removes it.
  • “Page 5 of ‘file.pdf’ does not exist”: the pages range goes past the end of the PDF. Check the page count, or use pages={3-} to run to the last page.

Just need one combined PDF?

If you only want to join several existing PDFs into one file, you don’t need LaTeX at all. Use our free tool to merge PDF files without LaTeX. Starting from Google Docs? You can combine Google Docs into one PDF directly.

If your LaTeX document has to go to Word users once it’s finished, see how to convert LaTeX documents to Word. More figure and table tutorials are in the LaTeX guides hub.

Frequently asked questions

How do I insert all pages of a PDF into LaTeX?

Load pdfpages and write \includepdf[pages=-]{file.pdf}. The dash means every page, from the first to the last.

How do I keep page numbers on inserted PDF pages?

pdfpages uses an empty page style by default. Add pagecommand={\thispagestyle{plain}} to the \includepdf options to print your document's page number on each inserted page.

How do I insert a landscape PDF page in LaTeX?

Add landscape to the \includepdf options to place the page on a landscape sheet, or angle=90 to rotate the inserted page itself.

How do I put two PDF pages on one sheet?

Use the nup option: \includepdf[pages=-, nup=1x2]{file.pdf} stacks two pages per sheet, and nup=2x2 puts four on each sheet.

Can I insert a PDF in Overleaf?

Yes. Upload the PDF to your Overleaf project, then use the same \includepdf or \includegraphics commands. Both packages are available on Overleaf without extra setup.