How to check and fix PDF files that cannot be included correctly using pdfpages and Xe(La)TeX?

I am currently writing my master's thesis and therefor I switched from pdfLaTex, which I was using earlier for my academic texts to XeTeX, because of the simplified workflow and unicode support. I am running MiKTeX under Windows and I am struggling with including one particular PDF. I am already including other PDF files without any problems, but the last one is driving me crazy. It's the statement of authorship, provided by my university. It can be found here. Note that including this PDF works fine when I build my project using pdfLaTeX. But when building using XeLaTeX, only blank pages are included.

So I started searching around the web for some useful information and I came up with some solutions, but none of them worked so far. So let me explain, what I have already tried.

First attempt: Rebuilding the PDF

First I tried to rebuild the PDF with GhostScript as described here. Basically I ran the following code:

pdf2ps auth_statement.pdf auth_statement.ps
ps2pdf auth_statement.ps auth_statement_new.pdf


This worked, however the font was totally messed up when including the newly generated PDF. Umlauts did not work at all. I also tried running ps2ps in between, as suggested in the linked answer, but this produced a 0 byte file.

Second attempt: pdfLaTeX + XeLaTeX

So I started writing a MWE and came over with the idea of including the PDF into a simple document, compiled with pdfLaTeX and use this output in my actual thesis. This works, but somehow affects the build of my thesis. Everything runs fine, I do not receive any errors, but the final PDF file is deleted immediately after the build process.

Now I am running out of ideas. Do you know how to check what causes the PDF to be included incorrectly? What else should/could I try?

Here's my MWE:

\documentclass[
11pt,          % 11pt, 12pt
a4paper,       % a4wide
]{scrreprt}

\usepackage{pdfpages}

\begin{document}
\includepdf{auth_statement.pdf}
\end{document}


Works fine when compiled with pdfLaTeX, but doesn't when compiled with XeLaTeX. I renamed the PDF linked above to auth_statement.pdf.

• xdvipdfmx warns that the document is encrypted: xdvipdfmx:warning: PDF document is encrypted. xdvipdfmx:warning: pdf: image inclusion failed for "./testimage.pdf". xdvipdfmx:warning: Could not find image resource... – Ulrike Fischer May 12 '17 at 9:05
• @UlrikeFischer Thanks for the answer. How did you get this warning? It does not appear in the log for me. However, XeTeX informs me, that it automatically detected the driver dvipdfm (instead of xdvipdfmx). Am I missing something here? – Carsten May 12 '17 at 9:25
• I compiled in two steps on the command line: xelatex --no-pdf file and then xdvipdfmx file. – Ulrike Fischer May 12 '17 at 10:29