# Scanned PDF inclusion problem with XeTeX driver

I have this specific problem about inclusion of my scanned PDF pages with existing LaTeX document.

I use an iPad application Scanner Pro to scan and create PDF copies of my hand-written notes. Then I would use `pdfpages` package to merge these PDFs with my LaTeX document.

So I added something like this in my `.tex` file:

``````\usepackage{pdfpages}
...
\includepdf[pages=-]{scanned_file.pdf}
``````

By several attempts, I discovered this oddity that

• if the `.tex` file was ran through `xelatex`, the scanned pdf file refused to be inserted, instead it simply left with as many blank pages as the original scanned file;
• if the `.tex` file was ran through `pdflatex`, the scanned pdf file would be inserted as expected.

Furthermore, I think that this is a problem relating to `graphicx` or `graphics` package, because the same behavior has been found when I tried to use `\includegraphics` command instead of `pdfpages` package to insert these stubborn PDF files.

I also tried explicitly setting driver option of `graphicx` to be `xetex` with no luck.

Here is (one of) my stubborn scanned PDF file, (It's on Dropbox, and it's written in Chinese...) providing for your test.

• the XREF table of the provided PDF appears to be broken. You can repair it with pdftk: `pdftk broken.pdf output repaired.pdf` – DG' Aug 16 '14 at 18:43
A fault in the XREF-table of your PDF seems to be responsible for the problems with `XeTeX`. You can repair your PDFs with a tool like `pdftk`:
``````pdftk broken.pdf output repaired.pdf