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.

I Want to print the borders of hyperref package in LaTeX. Using the package \usepackage{hyperref}, in the pdf file, some borders (red, green, etc) appears. When the document is printed the borders does not appear (which is logical).

Happens that I want to print those borders. Is it possible ?

share|improve this question
1  

1 Answer 1

up vote 1 down vote accepted

Your PDF reader decides whether these borders are shown and/or printed. If you want to make sure these are printed, you can use normal frames instead:

\documentclass{article}

\usepackage[hidelinks]{hyperref}

\begin{document}
This is a \href{http://tex.stackexchange.com/}{\framebox{link}}.
\end{document}

framebox creates a (black) frame, the hidelinks option to hyperref prevents the normal (non-printable) frame from showing up.


A macro to replace \href:

\newcommand{\framedhref}[2]{\href{#1}{\framebox{#2}}}
share|improve this answer
2  
I have more than 100 hyper references in my document so I'm looking for an automatic solution. Is it possible to change the definition in the pdf reader or use another one to print the borders ? –  PVaz Jul 30 '13 at 17:29
    
I don't know any PDF reader which will print these borders. Add the hidelinks, define a command for framed links (see my updated answer), and replace each occurrence of \href{ with the new macro. –  fefrei Jul 30 '13 at 17:35
1  
This will have problems if the linked text happens to be over two lines. For instance, try adding the following to the MWE: To get to your favorite site you need to click on the following \href{http://tex.stackexchange.com/}{\framebox{link to the \TeX{} Stackexchange site}}. with the \usepackage{showframe} to see. –  Peter Grill Jul 30 '13 at 18:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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