1

We have a main.pdf, and a cover image and a tex file. When we use texlive2013 to add the cover image and the contents of the tex file in the main pdf, the links in the main pdf breaks, in the sense the texts that were links are still coming in blue but they are not pointing to anything anymore, they are just normal texts.

Contents of the tex file:

\documentclass[a4paper,11pt]{article}
\usepackage{times,color,graphicx}
\usepackage[final]{pdfpages}
\renewcommand\familydefault{\sfdefault}
\definecolor{covergray}{gray}{0.5}
\usepackage[pdftex,%
  pdfstartview=FitH,%
  bookmarks=false,%
  colorlinks=true,%
  urlcolor=covergray%
]{hyperref}

\begin{document}

\thispagestyle{empty}%
\setcounter{page}{1}
\parindent=0pt\parskip=0.5pc

\begin{center}\bf
\vfill
\begin{center}
  \frame{\includegraphics[height=1.0\hsize]{cover.jpg}}
\end{center}
\vfill
\color{covergray}
Some text
\href{http://www.google.com}{http://www.google.com}
\end{center}
\includepdf[pages=-]{main.pdf}
\end{document}
Aritra
  • 11
  • 1
    This is well known, I'm not sure if there is any solution to this other than including the cover in the original file in the first place. I saw an explanation about this at some point but don't remember it. – daleif Jun 20 '13 at 14:11
  • @MartinSchröder, not really it was explaining why hyperrefs got lost. I don't understand much os the inner workings of PDF anyway. – daleif Jun 21 '13 at 08:30

1 Answers1

3

AFAIK all TeX drivers that can include PDF images strip the annotations from the pages including links.

Workarounds:

  • If main.pdf was generated via TeX, then the best strategy would be to add the cover page there to keep the links and outlines in main.pdf.

  • There is a project pax (PdfAnnotExtractor) that uses the Java library PDFBox (in an older version) to extract some annotations and a LaTeX package hooks into \includegraphics (used by pdfpages) to insert them afterwards.

  • PDFtk can keep some annotations:

    pdftk cover.pdf main.pdf cat output new.pdf
    

    but the outlines of main.pdf are lost.

Heiko Oberdiek
  • 271,626