I built a latex document and compress it afterwards with Ghostscript (gs). While some links are retained, e.g. urls, the links in the TOC and links created with autoref are not retained.

Adding the option -dPrinted=false option as described in Local hyperlinks broken after PDF processing with Ghostscript or Set the print flag on links with hyperref to preserve them with Ghostscript >= 9.25 did not work for the autoref or TOC links.

Would really appreciate some help or hints how to solve this!


    latexmk -pdf -halt-on-error -shell-escape main.tex

    gs  -sDEVICE=pdfwrite \
        -dCompatibilityLevel=1.4 \
        -dNOPAUSE -dQUIET -dBATCH \
        -dPrinted=false \
        -dPDFSETTINGS=/prepress \
        -sOutputFile=main_reduced.pdf \

\documentclass[a4paper, 12pt]{scrreprt}


    This is a reference to a figure \autoref{fig:figure} 
        \caption{This is a figure}
    \href{mailto:[email protected]}{[email protected]}

Ghostscript 9.56.1 (2022-04-04)

MacOS 12.4

  • -dPrinted=flase look false ;-) Commented Jul 24, 2022 at 7:58
  • Thanks for the hint. I checked again but it does not work either..
    – moschmdt
    Commented Jul 24, 2022 at 8:01
  • you are also missing the pdfa option, see tex.stackexchange.com/a/480700/2388 Commented Jul 24, 2022 at 8:13
  • I have already tried that before and href already works. My assumption is that there is a difference in the implementation of href and autoref because href works just fine.
    – moschmdt
    Commented Jul 24, 2022 at 9:06
  • hm yes, the destinations are gone. Ask on the ghostscript list. If they tell you what flag is needed one can perhaps activate it in hyperref. Commented Jul 24, 2022 at 9:46


You must log in to answer this question.

Browse other questions tagged .