[pdftex] hyperref and relative local files

James W. Haefner James.Haefner at usu.edu
Thu Feb 24 01:34:56 CET 2005

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

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.:

\href{file://subdir/index.html}{Test link}

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
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

Thanks in advance.


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