Closed muzimuzhi closed 7 months ago
Without \DocumentMetadata
you get the xmp-metadata added by Ghostscript; with \DocumentMetadata
the one added by the pdfmanagement code. Ghostscript honors then that there are user metadata and doesn't add its own, but it offers no option to add it as an uncompressed stream (I had a discussion about that https://bugs.ghostscript.com/show_bug.cgi?id=705962) and imho it doesn't react to the /setdistillerparams
either. The only way to uncompress it is to pass the options (in the few tests I have I normally use \DocumentMetadata{xmp=false}
as I didn't want to bother with this).
It seems https://bugs.ghostscript.com/show_bug.cgi?id=705962 only tells there's no way to uncompress the xmp stream solely, but didn't clearly say the /setdistillerparams
setting is not honored (on xmp stream added by the pdfmanagement code). Is it?
I retried. Even if I put the special in the background hook (where it is then before the pdfmark) the XMP stays compressed.
\AddToHook{shipout/background}{ \special{%
ps: /setdistillerparams
where
{pop << /CompressPages false /CompressStreams false >> setdistillerparams}
if
}}%
\input regression-test\relax
\DocumentMetadata{}
\showoutput
\documentclass{article}
\begin{document}
text
\end{document}
So I think there is nothing one can do unless ghostscript changes something and I'm closing here for now.
l3build
'sregression-test.tex
setsto uncompress pdf generated by
ps2pdf
.But if
\DocumentMetadata{}
is used, the/Type/Metadata
object in pdf is no longer uncompressed and one has to pass-dCompressStreams=false
tops2pdf
to re-enable uncompression (https://github.com/latex3/l3build/pull/278#issuecomment-1441325092). See an example diff hereThe
.tpf
files in current repo's directorytestfiles-dvips
also reflect this difference. Thus I suppose this is a known problem/limitation.From the intermediate ps files, it seems with
\DocumentMetadata{}
the corresponding special is inserted too late: