# latex-generated PDF has errors in Adobe Acrobat even though it opens fine in the Chrome PDF viewer and Mac OS X Preview

I've generated the following PDF using pdflatex: https://ofir.io/train_short_test_long.pdf

It can be viewed perfectly fine if opened in the Chrome PDF viewer or in Preview in Mac OS X, but if I open it in Adobe Acrobat Reader I get the following error:

And what happens is that most of the PDF looks totally fine in Acrobat but the following figures are not displayed: 4,5,6,7(b),10

Which is very weird since I used the same software (matplotlib) to generate all the figures. And I use identical graphicx commands to include all figures in the document.

This problem still occurs even when I compile with LuaLaTex. Those figures are all PDF files themselves, and if I open just the figure in Adobe it works fine. When compiling the PDF there's no errors and just 1 warning about a table. Lastly, I've heard from a user of OneNote that a similar error occurs when the PDF is opened there.

Thanks so much!

• With evince, I get the following error message: invalid value for a dash setting... Aug 28, 2021 at 5:47
• With ghostscript, I get the following error messages: Form stream has unbalanced q/Q operators (too many q's) and Form stream left garbage on the stack, attempting to recover. (on each invalid pictures). Aug 28, 2021 at 5:50
• Thanks so much, that's definitely more information than I had before. But its not clear what the workaround is, are you aware of any? I've been googling these error messages and can't really find a solution yet. One thing I might try is to export these images in a different format because it seems like the PDF format here might be the issue. Aug 28, 2021 at 7:34
• Not all Acrobat Readers are the same ... To localize the error I suggest this procedure on a dedicated Latex copy: 1) Divide your code into two parts A and B. 2) Delete A, compile, check with several Acrobat Readers, and repeat with B as well. 3) Repeat with the part that contains erros (can be both parts). // Converges quickly with 2^n ... // Don't forget to try an empty \begin{document} \end{document}, and to comment out some or many \usepackage declarations. // Purpose is to find hints quickly. Aug 28, 2021 at 10:24
• This looks very much like matplotlib is generating corrupt PDFs. Can you share the code to create one of the broken figures? Aug 29, 2021 at 20:23