On 04/07/2024 04:49, Greg Marks wrote:
$gs -dQUIET -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -dCompressFonts=true -dSubsetFonts=true -sFONTPATH=/usr/share/fonts/ -o new.pdf old.pdf
[...]
The object number and generation number shall be separated by a single white-space character. The generation number
[...]
The stream keyword shall be followed either by a CARRIAGE RETURN
I expect that pdftk and qpdf have their own serializers. I have no idea if they can transform a file to a PDF/A compliant document, but they might use proper separators.
Perhaps LaTeX documents require some tuning (metadata blocks, etc.). If you use pdflatex then I would try lualatex.