View Single Post
Old 09-01-2009, 10:57 AM   #1
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
ePUB with PDF embedded test

As I pointed out in this post, the ePUB spec allows including PDF documents as alternative renderings for chapters.

This is a test for this feature. It is my version of "Gulliver's Travels", with a PDF version of each chapter (at 9×12cm), and the standard XHTML as a "fallback". According to the spec, a reading system that supports PDF could show the PDF version, while those that don't will display the normal (XHTML) text. I don't know, however, if there is any system that supports this, but it may be worth testing.

The first thing I notice is that the book becomes huge. The normal ePUB version is 500 kB, the PDF version is 1.8 MB, and this "hybrid" version is 14MB! This is size increase is due to splitting the PDF in one file per chapter. I could include the whole book as a single PDF, but then I'd have to put all the XHTML text in a single file too (the alternatives are defined on a per-file basis).

So, feel free to try this in your readers (PC software or portable) and report any success or problem

PS. The technique is very easy, just check the "content.opf" file. In the manifest use:

Code:
<item id="Preface-1_pdf" fallback="Preface-1" href="pdf/Preface-1.pdf" media-type="application/pdf" />
<item id="Preface-1" href="Preface-1.xhtml" media-type="application/xhtml+xml" />
and in the spine:

Code:
<itemref idref="Preface-1_pdf" />
Attached Files
File Type: epub Gullivers Travels.epub (13.17 MB, 502 views)

Last edited by Jellby; 09-01-2009 at 11:06 AM.
Jellby is offline   Reply With Quote