5

With pdflatex, I used to write \pdfcompresslevel 0 and \pdfobjcompresslevel 0 before the \documentclass command. This would disable the PDF compression which in turn speeds up the generation of the PDF file.

However, these commands do not seem to work with LuaLaTeX. Is there a way to speed up the generation of the PDF file, e.g., by also disabling compression?

2
  • Have you tried {\pdfvariable compresslevel}? See TUGboat, Volume 37 (2016), No. 1. Hans Hagen’s article on LuaTEX 0.90 backend changes.
    – Thérèse
    Commented Feb 3, 2021 at 20:02
  • Do you have any benchmarks showing that pdf compression slows down the document generation? I highly doubt that this has any effect on speed. My measurements were all within the same range.
    – topskip
    Commented Feb 4, 2021 at 8:44

2 Answers 2

8

I use (in texlive 2022)

\RequirePackage{expl3}
\ExplSyntaxOn
\pdf_uncompress:
\ExplSyntaxOff
\documentclass{article}
 ....

or (with the new pdfmanagement + latex-dev 2022-06-01)

\DocumentMetadata{uncompress}
\documentclass{article}

to get uncompressed pdf. That works for all engines.

5
  • Ulrike, I don't know what changed, but at the moment I had to require expl3 instead of l3pdf (and not requiring anything, found a defined \pdf_uncompress: but missed compression levels along the way).
    – gusbrs
    Commented Jun 1, 2022 at 19:51
  • @gusbrs l3pdf is gone, it is now in l3kernel, I updated the answer Commented Jun 1, 2022 at 20:21
  • That's what I assumed. Thanks! I'm not sure when and why explicitly loading expl3 is still needed, but it's working good. :)
    – gusbrs
    Commented Jun 1, 2022 at 20:23
  • @gusbrs one must load expl3 to force the loading of the backend driver as uncompressing is backend dependant (as the question shows ...). Commented Jun 1, 2022 at 20:29
  • Got it! Thanks again.
    – gusbrs
    Commented Jun 1, 2022 at 20:31
2

After \edef\pdfcompresslevel{\pdfvariable compresslevel} \edef\pdfobjcompresslevel{\pdfvariable objcompresslevel} you have the mentioned commands as in pdfTeX.

However, the speed problem is in LaTeX itself, no in compression PDF. I am using OpTeX with LuaTeX and I don't have problems with speed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .