After normal compiling, I am processing a PDF file with the following
ghostscript command in order to produce a (hopefully) PDF/A compliant file.
gs -dPDFA -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -dPrinted=false -dPDFSETTINGS=/printer -dSAFER -dNOPAUSE -dQUIET -dBATCH -dNOOUTERSAVE -sColorConversionStrategy=UseDeviceIndependentColor -sProcessColorModel=DeviceRGB -sOutputFile=thesis.pdf main.pdf pdfmarks
This mostly works (I have a working outline in my PDF viewer and hyperlinks also work now), except for one thing. The text is selectable and copyable on almost all pages, except for pages which contain images. It does not matter if the image is another PDF or a PNG. Tikz pictures and MetaFont images are fine, though.
I tried a different
/prepress and in an earlier iteration of this command also without
The original PDF file is compiled with
pdflatex, if it makes any difference.
This question is quite difficult to research, since almost all ghostscript documentation contains the words "text" and "image".