I have an old workflow that uses LaTeX itself to process diagrams and plots. I've used this generate hundreds of figures over the years. This has suddenly started producing invalid pdf figure files: they won't open in Acrobat (though they do open in SumatraPDF); including them in a document causes luatex to output several warning messages (invalid compressed object) and a corrupt final file. Strangely, they do seem to work with pdftex.
Compiling this document with lualatex is enough to trigger the problem on my machine.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=\textwidth]{embed.pdf}
\end{document}
Here is embed.pdf
The figure was initially generated by gnuplot, using the following:
set term postscript eps mono
set output "fig.eps"
plot x**2 title "AAA"
I then created a version with a Greek letter by compiling this document (embed.tex) using latex+dvips
\documentclass{article}
\usepackage{graphicx}
\usepackage{psfrag}
\pagestyle{empty}
\begin{document}
\psfrag{AAA}{\(\alpha\)}
\includegraphics{fig.eps}
\end{document}
Finally, I did
ps2eps --ignoreBB embed.ps
epstopdf embed.eps
to create the pdf figure. Converting embed.eps to pdf using cloudconvert.com does seem to work, so I think the problem is caused by either epstopdf or ghostscript. What's going on here?
I think this old question is probably related, but there is no example pdf file so it's impossible to be sure.
EDIT
It seems increasingly likely that something is going wrong at the very last step (eps2pdf conversion). Here is the eps file that is being converted: embed.eps. What's not clear is whether the issue is limited to my own machine (running texlive 2025 under cygwin).
embed.pdf:$ qpdf --qdf embed.pdf - > /dev/null WARNING: embed.pdf: object 6/0: error reading object: integer out of range converting 30064771072 from a 8-byte signed type to a 4-byte signed type WARNING: embed.pdf (object 8 0, offset 235): stream dictionary lacks /Length key WARNING: embed.pdf (object 8 0, offset 281): attempting to recover stream length WARNING: embed.pdf (object 8 0, offset 281): recovered stream length: 1210set termoption enhancedand then using either{/Symbol a}or utf8αin the title of the plot. Then you can export from gnuplot to pdf directly without the route through eps-psfrag-ps2pdf-epstopdf which could lead to errors as you have experienced now.