1

I am trying to get a small PDF output from pdftex.

From pdftex reduce PDF size: reduce image quality? I found the useful command

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=small.pdf big.pdf

that allows me to set the image resolution for the PDF. But this command removes all the document hyperlinks generated by \cite and \ref in LaTeX.

So, how can I decrease the PDF size but keep the hypertext information?

  • General compression of pdf often degrades quality of image linework what is needed is an optimum value for included png by default they should be 96dpi at 1:1 such that a pixel is a bit thiner than 1pt if you calculate the include scale so that at 1:1 they are 96/72 inches then one pixel should be roughly 1 pt and linework acceptable if you get ratios right then there is no need to run additional GS or other conversion. It may need a bit of trial and error to get perfect results and a alternating pixel gridded image helps to see the effects but usually worth it. –  May 29 '19 at 14:24
  • YEs, this can be rech by -xResolution=??? in gs. But running it the output PDF results without any hyperref. – user189994 May 29 '19 at 15:49

1 Answers1

1

You need to use the pdfa option of hyperref. It sets a flag that prevents that links are lost.

The pdfa has more effects, but currently there is no way to set the flags independantly (but this can change in the future).

Ulrike Fischer
  • 327,261