View Full Version : Challenging! Link to hidden html file in ePub


RJamesW
09-17-2010, 06:05 PM
Hello forum,

I'm trying to do something that may not be possible in ePub.

I want to link from the text in a chapter to an html file that does not appear in the reading order. I.e., if you were to page through the ePub, the content of that html file would not appear. It can only be linked to. A link on that page would return the reader to the main content.

I've tried modifying the <spine> section in the OPF so that linear is set to "no" for the item as follows:

<itemref idref="tgt01" linear="no">

But this doesn't work in ADE or Sony (or Kindle for that matter when the file is converted to .prc). I've also tried removing the file from the <manifest> section of the OPF, but you cannot link to un-manifested files in ePub.

Does anyone have any ideas on how to accomplish this?

Thanks!
RJW

ATDrake
09-17-2010, 07:45 PM
Currently, it doesn't look like it can be done if linear="no" isn't doing it with your test-readers.

Probably the most you could really do right now is as Barnes & Noble does for the footnotes in their Classics editions, and have those files located after the end of the rest of the book, when most people will have stopped reading anyway.

But this may not be enough for the effect that you want.

Also, welcome to MobileRead!

Jellby
09-18-2010, 05:12 AM
I've tried modifying the <spine> section in the OPF so that linear is set to "no" for the item as follows:

<itemref idref="tgt01" linear="no">

That is the way, and it works in Calibre. Unfortunately, reading systems are not required to do anything particular with non-linear elements:

"Reading Systems are not required to differentiate between primary [linear="yes"] and auxiliary [linear="no"] content, and for the requirements and recommendations given in this section may consider all OPS Content Documents in spine to be primary, regardless of the value of the linear attribute."

Removing the file from the <spine> or the <manifest> would produce invalid ePUB files, so don't do it. Instead, write a polite letter to Adobe (and Sony, and others) asking them to implement the distinction between primary and auxiliary content.

RJamesW
09-20-2010, 04:45 PM
Thanks Jellby and ATDrake for the information. I'm new to this forum, as you know, but I anticipate many return visits.