Skip to main content

EPUB

Both versions 2.0 and 3.0 are supported. Both flow and fixed variants are supported.

We do not recommend the fixed option as we don’t have a good experience with it. It is much better to upload flow EPUB and PDF.

Output formats

Miguel can create MOBI and PDF from EPUB. If a social DRM template is set up, this page will also be embedded in the converted formats.

If you use the order mode (see Usage > API) or connect to Shoptet, both MOBI and PDF are automatically created from EPUB; if you do not want to use this feature and want to turn it off, you need to contact support at miguel@servantes.cz for the time being.

Validation

When the EPUB format is uploaded to Miguel, the entire file is validated using the official EPUBCheck tool and the generation of all possible formats is tested. This process can take a few minutes but ensures that everything works as it should.

If you have problem understanding what the problem is, just contact us at miguel@servantes.cz and we can help you figure it out.

An error can look like this:

ERROR(RSC-005): ebook_sazba-2.epub/OEBPS/toc.xhtml(9,10):
Error while parsing file: element "ol" incomplete; missing required element "li"

If we go through the whole line from the left, there are these parts:

  • ERROR - error level (there can also be INFO or WARN, these are just informative, validation still goes through).
  • RSC-005 - error code
  • ebook_sazba-2.epub - EPUB file name
  • OEBPS/toc.xhtml - path to the EPUB file in which the error is located
  • (9,10) - position in the file where the error is located (line number, position on the line). In this case the error is on line 9 and position 10
  • the rest is an error message

To edit the file and possibly fix any error in EPUB file, we recommend Sigil editor.

Common errors

The most common errors are wrong links in the book, missing file or missing content (note that EPUB has its own internal structured content).

Missing content

For example, this is what an error looks like when there is missing content in the book (the internal structured content in EPUB):

ERROR(RSC-005): file_name.epub/OEBPS/toc.xhtml(9,9):
Error while parsing file: element "ol" incomplete; missing required element "li"

Here's an example of when there's a link to another place in the book (like another chapter) and the file doesn't exist:

ERROR(RSC-007): file_name.epub/OEBPS/text/chapter_01.xhtml(15,84):
Referenced resource "OEBPS/text/nonexisting_file.xhtml" could not be found in the EPUB.
  • text/chapter_01.xhtml - file with wrong link
  • (15,84) - 15th line, position 84 (84th character from the beginning of the line)
  • text/nonexisting_file.xhtml - the referenced file that is missing

Missing file

An example of what the error message looks like when a file is missing: images/image.jpg:

ERROR(RSC-001): file_name.epub(-1,-1):
File "OEBPS/images/image.jpg" could not be found.

Forbidden value attribute

An example of using value attribute in <li> element:

ERROR(RSC-005): file_name.epub/index_split.htm|(11,54):
Error while parsing file: attribute "value" not allowed here; expected attribute "class", "dir", "lang", "style", "title" or "xml:lang"

For some reason the value attribute is not allowed in the <li> element. You need to remove it.

Social DRM

Miguel can insert a new social DRM page into an EPUB or edit an existing one. To work properly, you must set up a template or insert a file with a special name into the EPUB. The template is described in the settings.

Inserting manually

If you want a different template for each book, it is possible to create a file in EPUB with the names social_drm , social-drm, or socialdrm (the extension is not important in this case).

Inserting automatically

For automatic inserting you need to set up a template in the administration (see Miguel Settings > DRM template).

Miguel tries to insert the page in the appropriate place at the beginning of the book, searching for a place according to the following priorities:

  1. after the imprint
  2. after the cover
  3. after the contents
  4. before the main text

It is decided based on EPUB landmarks, so it is advisable to set these landmarks in EPUB to put the page in the best possible place.