0

I need to change my long physics book pdf file for printing. (The downloadable pdf with clickable links and embedded films will remain available and free.) The printer asked to take out all links from the pdf file. However, I would like to keep the original link colors. What is the best way to do it? Here are the details.

Most links are internal cross links, some links are defined with \url. The link colors are defined in hyperref. And I use the tex-dvi-dvips-pdf route. In addition, I need a solution with commands that can be loaded AFTER \usepackage{hyperref} has been called. At present I have two issues.

(1) If I use \let\url\nolinkurl, the corresponding links are gone, but so is their color. How can I keep the colors of the link texts? (Knowing that some links have special characters.)

(2) If I embed the whole text in \begin{NoHyper} ... \end{NoHyper} the internal crosslinks are gone, but the text that used to be a link is black. This happens in figure references, in the table of contents, in the subject index, etc. And I do not understand where to set the color now. And all the backrefs are also gone.

Any help would be very appreciated!

  • When the printer asked you take out the links, it is likely that what they really meant is to take out the special colouring of the links. After all, the printer is concerned with the visual appearance of the printed page and not the interactive behaviour of the PDF as viewed onscreen in a PDF viewer. So keeping the appearance but removing the links is probably the opposite of what they want. Please check with them. – ShreevatsaR Sep 8 at 15:30
  • No, the printer system gets confused by the (hyper-)links themselves, and wants a PDF/X file. After I took out the links, the printer system worked - I tested that already. – Motion Mountain Sep 8 at 15:38
  • Oh I see, the printer is an object, not a person… sorry been reading/watching too much old stuff lately and got confused. – ShreevatsaR Sep 8 at 15:46
  • Off topic, Acrobat professional have option to switch-off all the links, do this helpful for you? – MadyYuvi Sep 9 at 7:12
3

It seems that a solution to problem 1 is this one:

\def\url#1{\textcolor{mylinkcolor}{\nolinkurl{#1}}} 

instead of

\let\url\nolinkurl

For problem 2, apart the solution given by Ulrike Fischer, there is also the option to transform a linked PDF into a PDF/X using Acrobat Professional, as mentioned by MadyYuvi in a comment.

In fact, there is one further way in Acrobat Pro: to use "Save as optimized pdf" and choose the settings so as to take all the links out.

2

Create a small wrapper mythesisprint.tex and input your pdf with pdfpages:

\documentclass{book}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=-]{mythesis}
\end{document}

This will keep the colors but strip the annotations.

2

The ps2pdf route implements all interactive PDF features by means of the pdfmark PS operator. An efficient way to remove all interactivity without changing the visual appearance of the text might be neutralizing pdfmark and ?pdfmark:

\documentclass{article}
\usepackage[colorlinks]{hyperref}

\special{!
  userdict /?pdfmark systemdict /pop get put
  userdict /pdfmark systemdict /cleartomark get put
}

\begin{document}

Go to page~\pageref{hello}.

\url{http://ctan.org}

\newpage

hello!\label{hello}

\end{document}
  • The given suggestion works fine for \label and \ref but still the link comes for \url tag. Can you advise? please... – MadyYuvi Sep 14 at 6:23
  • @madyyuvi This link is autogenerated by the PDF viewer, in your case most likely Acrobat Reader, I guess. This happens with any text that looks like a URL, even without underlying PDF annotation. – AlexG Sep 14 at 7:36
  • Thanks, I too thought the same, anyhow, much thanks for your confirmation.... – MadyYuvi Sep 14 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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