Text Formatting ⇒ link to a pdf document
link to a pdf document
Hi there,
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
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
link to a pdf document
You could do that with the hyperref package. E.g., if the two PDFs were in the same folder, you could just use something like this:
For more info, see the hyperref documentation.
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.
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
Hi there,
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
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.
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
Re: link to a pdf document
Hi there,
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
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
In that case I'm not sure how to do it - I hope someone else can figure it out for you 

OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
Re: link to a pdf document
Relative paths work for me.
However, try also:
\href{file:///C|/My Documents/folder/mypdf.pdf}{Click here.}
However, try also:
\href{file:///C|/My Documents/folder/mypdf.pdf}{Click here.}
Re: link to a pdf document
Hi there,
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
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
frabjous, fatra2: what LaTeX distributions / OSes you have? Just maybe that is important there? How else can relative paths work for one, but fail for another?
link to a pdf document
I'm using TeXLive 2008 on Ubuntu 9.04 (Linux). Relative paths work.
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):
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}