[pdftex] hyperref and relative local files

James W. Haefner James.Haefner at usu.edu
Thu Feb 24 02:19:15 CET 2005


Follow-up:  I've learned that the following works in Windows using
acrobat 6.0:

\href{run:subdir/index.html}{Local}

-j


On Wed, 2005-02-23 at 17:34, James W. Haefner wrote:
> I apologize for this mostly off-topic question, but I do not have access
> to comp.text.tex and there may be a relation to pdftex... I'm using
> hyperref version hyperref 2003/11/30 v6.74m.   Here's what I tried to
> post:
> 
> This question/problem has been asked many times before, but so far 
> it has not been answered that I can tell after googling the archives. 
> Hopefully I missed something obvious.
> 
> I want to put a pdf with hyperref on a CD and have a link
> to a local file that will be opened by a browser.  E.g.:
> 
> \documentclass{article}
> \usepackage{hyperref}
> \begin{document}
> \href{file://subdir/index.html}{Test link}
> \end{document}
> 
> where "subdir" is a directory on the CD and index.html is 
> is an index file for a html file on the CD.  
> I've tried various permutations of the \href
> line (eg, 0 slashes, 3 slashes, a leading dot), but mostly I get the
> error:
> Can not open "file:/subdir/index.html"
> 
> In other words, something is putting a forward slash
> in front of the path.  Is there no way around this, even an inelegant
> hack involving a hand-coded \special?  Is it a problem with hyperref or
> browsers?  How can I solve my problem?  (Clearly, a CD can be mounted
> anywhere, so absolute paths (which work correctly) are not a viable
> solution.)
> 
> Thanks in advance.
> 
> Jim 
-- 
James W. Haefner             Email: James.Haefner at usu.edu
Dept Biology/Ecology Center  Voice: 435-797-3553
Utah State University        FAX:   435-797-1575
Logan, UT 84322-5305




More information about the pdftex mailing list