# pdflatex generates corrupted PDF

I have the following minimal example (jrnl.tex):

\documentclass[journal]{IEEETran}
\ifCLASSINFOpdf
\usepackage[pdftex]{graphicx}
\graphicspath{{pdf/}{jpeg/}{png/}}
\DeclareGraphicsExtensions{.pdf,.jpeg,.png}
\else
\usepackage[dvips]{graphicx}
\graphicspath{{../eps/}}
\DeclareGraphicsExtensions{.eps}
\fi
\ifCLASSOPTIONcompsoc
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\else
\usepackage[caption=false,font=footnotesize]{subfig}
\fi

\begin{document}
\begin{figure}
\centering
\subfigure[]{\includegraphics[width=0.8\linewidth]{fig1-a.png}}
\vfill
\subfigure[]{\includegraphics[width=0.8\linewidth]{fig1-b.pdf}}
\vfill
\subfigure[]{\includegraphics[width=0.8\linewidth]{fig1-c.png}}
\caption{...}
\label{fig2}
\end{figure}
\end{document}


The jrnl.pdf generated by pdflatex jrnl.tex cannot be viewed in Acrobat Reader X (Windows 7). The error message is “the document is damaged and cannot be repaired”.

The fig1-b.pdf, generated by PowerPoint2016, seems to trigger the trouble because I can replace fig1-b.pdf with fig1-b.png and the jrnl.pdf can be viewed successfully. Other pdf files that not from PPT can also be used.

Why is this and what can one do about it?

• Welcome to TSE. What happens when you view the file fig1-b,pdf in Acrobat Reader X? – José Carlos Santos Apr 28 at 8:17
• You have to repair fig1-b.pdf. When you \includegraphics a PDF file, it is just embedded verbatim in your document and if that PDF is damaged, your whole PDF will be damaged. – Henri Menke Apr 28 at 8:42
• The fig1-b.pdf generated by PowerPoint2016. I have tried other PDF file that not from PPT and it works well. @HenriMenke – Chang Li Apr 28 at 9:37
• IF the cause is PowerPoint generated PDF has been cropped by another application then the best test is use PowerPoint to generate a smaller area. In many apps when printing it is possible to specify a selection or view to print at a given scale rather than a page with margins. If it is the system PDF generator try a different generator e.g. if you have acrobat distiller and Microsoft print to PDF test both – user170109 Apr 28 at 9:40
• Avoid any of the download this to "let me fix your pdf" solutions either you have a poor / interupted ppt2pdf workflow or possibly a problem content included in the ppt. Generic solutions are unlikely to help, having said that it is odd that MS suggest running (and users have had success with) PPT in "safe mode" see support.microsoft.com/en-us/help/3102551/… this suggests the pdf generation is susceptible to background interference – user170109 Apr 28 at 10:02