I usually compress my tex
PDFs with ghostscript
:
pdflatex -shell-escape file.tex
gs -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/prepress \
-dNOPAUSE -dQUIET -dBATCH \
-sOutputFile=file_compressed.pdf \
file.pdf
Normally that works well, but if I have relative links to local files, the links don't work afterwards.
Minimal example:
\documentclass{beamer}
\usepackage{hyperref}
\begin{document}
\begin{frame}
\href{run:./audio.mp3}{test}
\end{frame}
\end{document}
The link works in file.pdf
but not in file_compressed.pdf
. Is there any pdflatex
or ghostscript
setting that retains the link in the compressed version?
I use Acrobate Reader 10.1.14 for viewing, Ghostscript 9.10 and pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014) on OS X 10.9.5.
Update: The breakage of hyperlinks had nothing to do with compressing the PDFs. The breakage happened for all re-processing of PDFs containing hyperlinks in its input PDF.