latex3 / pdfresources

LaTeX PDF resource management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pdfmanagement-testphase: how to set compression level

koppor opened this issue · comments

The documentation states following:

Some first steps for better support of PDF related commands have been already done
with the l3pdf package which has now been integrated into l3kernel. It offers backend
independent commands to create PDF objects and destination, to set the compress level
and the PDF version.

Source: https://ctan.tetaneutral.net/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.pdf

However, I cannot find any more information on that in the documentation.

I currently do the following, but the PDF is very large:

\RequirePackage{pdfmanagement-testphase}
%\DeclareDocumentMetadata{compress}
\documentclass{llncs}

\directlua{
  require("newpax")
  pdf.setcompresslevel(9)
  pdf.setminorversion(10)
}

The default compression level is already high: the reason we expose a setting is to turn it down/off for debugging! You are likely best looking at post-processing your PDF as GhostScript can often save size.

@josephwright Thank you for hint. I still need to create a MWE in the context of newpax (https://github.com/u-fischer/newpax) since I have strange things going on there.

Until that, I'll try to "just" compress the PDF using pdfsizeopt (hint from https://tex.stackexchange.com/a/215328/9075)