# \includepdf only shows first page

Using XeLaTeX I am trying to add a PDF to my file. Only the first page the PDF is included in the output file.

The following MWE refers to a PDF I created using Apple's TextEdit and 'Save as PDF' from the Print dialog. The contents are simply: 'Page 1', 'Page 2' etc. on each page.

\documentclass{article}

\usepackage{pdfpages}

\title{Minimal Working Example}
\date{}
\author{Author}

\begin{document}
\maketitle

\section{Section 1}
Content

\includepdf{test-pdf}

\end{document}


According to the pdfpages documentation, this is the default behavior when including pdfs with \includepdf. In order to get all the pages, you need to type:

\includepdf[pages=-]{test-pdf}

• Can this be the default somehow? Jul 9, 2020 at 22:14
• \includepdfset{pages=-} for setting global options Feb 14, 2021 at 15:07

I've observed the issue you describe even with the [pages=-] option provided. pdflatex worked as expected, but xelatex only included the first page, and even failed with an error if I explicitly set the page range to include the second page of my multi-page PDF:

Package pdfpages Error: page 2 of 142952.PDF' does not exist.


The issue turned out to be triggered by an upper-case file extension (i.e., .PDF) on a case-sensitive file system.

Changing the file name from 142952.PDF to 142952.pdf solved the problem with XeLaTeX. And of course, if the file extension is lower-case .pdf, it can also be omitted in the \includepdf argument.

In my case (Linux) it had problem when file contained . or - before .pdf`. Renaming helped.