Text Formatting ⇒ link to a pdf document
link to a pdf document
I am stumped. I thought it would be terribly simple, but I can seem to find the answer to this question.
I would like to make a reference/link to a local pdf document. A bit like with a html hyperlink, I would want the output to be a "clickable" link that opens the document with adobe reader or something. Is there anyway to do so???
Cheers
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
link to a pdf document
Code: Select all
\documentclass{article}\usepackage{hyperref}\begin{document}\href{mypdf.pdf}{Click here to open mypdf.pdf!}\end{document}
I have to confess I don't see the point of such a thing, however. The link would only work for someone with both pdfs in the same folder. Consider using pdfpages instead just to include the one PDF inside the other. You could still use hyperref, only with internal links, from one part of the document to another.
Re: link to a pdf document
Fact is that is works fine, as long as mypdf.pdf is in the same folder as the source code. But what if I want to refer to a file in another folder???
Cheers
link to a pdf document
I'd guess that you could just use some other relative path - i.e. .../otherdirectory/mypdf.pdf instead of just mypdf.pdf (note that the .../ means that you go one directory "up").fatra2 wrote:But what if I want to refer to a file in another folder???
I've not tested it - but I think it should work.
Re: link to a pdf document
That's where I'm stumped. It does not seem to work with a relative path (../folder-something/mypdf.pdf), nor with a definitive path (D:/My documents/folder/mypdf.pdf)
Cheers
Re: link to a pdf document

Re: link to a pdf document
However, try also:
\href{file:///C|/My Documents/folder/mypdf.pdf}{Click here.}
Re: link to a pdf document
From my understanding, this is not a relative path. On top, I don't understand, I tried varying many different parameters from what you say, and it does not seem to work for me. Don't know. I guess I'll stick with the reference to a file in the same folder, much less complicated, and mor portable. I just need to send the folder as a zip file to have a working .pdf document.
Cheers
-
- Posts: 50
- Joined: Sat May 23, 2009 10:13 pm
Re: link to a pdf document
link to a pdf document
But I dual boot with Windows XP with MikTeX installed. I'll check that when I get a chance.
UPDATE:
Checked on Windows with MikTeX 2.7, compiling with pdflatex. Relatve paths work there too.
Could the issue be with the pdf viewing software? I'm using evince on Ubuntu, and Acrobat reader on Windows.
Code used (verbatim):
Code: Select all
\documentclass{article}\usepackage{hyperref}\begin{document}\href{../target.pdf}{LINKY!}\end{document}