Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

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}
share|improve this question

marked as duplicate by Martin Schröder, Heiko Oberdiek, mafp, T. Verron, Thorsten Jun 21 '13 at 9:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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
    
Welcome to TeX.SX! –  Papiro Jun 20 '13 at 14:12
    
@daleif: This one? –  Martin Schröder Jun 21 '13 at 8:20
    
@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 8:30

1 Answer 1

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.

share|improve this answer
    
sorry for my ignorance, but what is outlines in this context? –  daleif Jun 20 '13 at 14:21
1  
@daleif: Bookmarks. –  Heiko Oberdiek Jun 20 '13 at 15:53
    
Thanks for the comments. Will try to use pdftk and see if it works. –  Aritra Jun 25 '13 at 9:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.