Search code examples
epubdocbook

DOCBOOK to EPUB File Size


Some eBook reading devices (like older Kindles) perform better with OEBPS/Text file sizes in the 350KB range. When you go over that, page load and scrolling can be a miserable user experience.

Question: If you have a large text, 4 MB for example---Will the DOCBOOK to EPUB publishing flow put that into OEBPS/Text that as a monolithic 4MB file, or will it split it into smaller files for you?

If it splits the file, does it repair the anchor IDs to reflect the new file name?

I couldn't find the answer to this at docbook.org.


Solution

  • Question: If you have a large text, 4 MB for example---Will the DOCBOOK to EPUB publishing flow put that into OEBPS/Text that as a monolithic 4MB file, or will it split it into smaller files for you?

    The "DocBook to EPUB publishing flow" (DocBook XSL) will split the input XML into smaller output files.

    This process is called "chunking" and is described in detail here: http://www.sagehill.net/docbookxsl/Chunking.html (this is a section from the book DocBook XSL: The Complete Guide).

    If it splits the file, does it repair the anchor IDs to reflect the new file name?

    I am not completely sure what you mean by "repair the anchor IDs", but the chunking process does ensure that cross-references and entries that go in to *.opf and *.ncx files are correct.

    EPUB is one of many output formats that can be created from DocBook sources. If you have never used DocBook XSL before, you should read "DocBook XSL: The Complete Guide" (see link above). This book does not cover EPUB output specifically (it was written before the EPUB stylesheets had been developed).

    DocBook XSL provides stylesheets for both EPUB 2 and EPUB 3 (most of the effort goes into EPUB 3 these days):