View Full Version : Hyperlink to PDF

04-14-2013, 03:26 PM
Hi all,

I'm trying to set up a relatively straightforward workflow for converting InDesign documents from a reprint title list to epubs, using Sigil as final editor. I've run across a curious problem:

Using hyperlink panel in InDesign, I referenced a "pdf" within a document and exported to epub. The epub highlights link as a hyperlink, but either does nothing or jumps back to previous entry in content list when viewed in a reader app. The pdf does not appear.

I opened up the epub and added the pdf file to "Misc" folder and linked to it using standard "a ref" code, as in:

<p class="text"><a href="/Misc/Harriman97LakesE.pdf"><span class="txtbital">Lakes Chart</span></a></p>

Adobe Digital Editions simply crashes when I hit the hyperlink, and Firefox "e" addon pushes to next item in content list.

I'm missing something simple here, but can't figure it out . . . any ideas?


04-15-2013, 03:08 AM
The link is wrong in the first place, it should be ../Misc/Harriman97LakesE.pdf because the paths are relative.
On the other side, I doubt this is going to work in a normal ePUB. External links usually don't really work for other documents than XML or (X)HTML. They might on iBooks though.

One of the reasons is, on most readers though, that although they support PDF files, another reading program is used for it.

04-15-2013, 12:07 PM
Yes, I initially entered the link with the relative path "../Misc/etc", but to no avail; what I posted was the last of many attempts to get the address correct. When I attempt to open in Adobe Digital editions, even with correct path, I get an error message : invalid link.

I wasn't aware of pdf issues on readers, thanks for the info

04-15-2013, 02:10 PM
I don't think that is allowed by the ePub spec. Even if a given reader is able of rendering a PDF, you'd be linking to a document that's not in the spine (because a PDF is not an allowed type in the spine) and then the reader wouldn't know what to do with the page back or forward actions, or what "page number" to show in case it has that feature.

It might be possible through fallbacks and that, but I doubt that you'd get much farther.

04-18-2013, 05:20 PM
Toxaris is right here: if you put the PDF inside the container, you can link to it via a relative URI. However, good luck with having it working.

It is the same problem I am running in the EPUB3 Audio-eBooks my company is producing: we put in the container an M3U playlist, hoping that someday, some Reading System will support it, e.g. letting the user choose between "listen only" and "read + listen" modes.

The same applies to your embedded PDF: maybe some day RS will "realize" that the link points to a PDF, and suitably render it.