Continued from Docbook and EPUB Part 1
Compressing and Renaming
EPUB is nothing more than a zipped file with the file extension changed to EPUB. The XSLT stylesheet creates the META-INF and OEBPS folders and the necessary toc, XHTML, and content.opf files, but it won't compress the files automatically into a zip. However, there are advantages to manually zipping the files, such as making sure all the images are in the OEBPS folder and adding a mimetype.
To zip the necessary files into an EPUB in KDE:
1. Select the META-INF, OEBPS folders and the mimetype file. Do not include the original Docbook .xml file.
2. Right-click and click Compress. Click As ZIP Archive.
3. To rename the file, right-click, then select Rename... Input an ebook name with an .epub file extension.
Editing in Sigil
It's always a good idea to validate and test the EPUB using a variety of devices and another EPUB application. The developers of Sigil knew what they were doing when they wrote the excellent ebook editor, which can examine the contents of an EPUB file and validate the EPUB for compatibility.
Open the newly created EPUB file using Sigil and use the Book Browser pane to preview the individual .xhtml files stored in the Text folder.
If the images aren't displayed when viewed using an EPUB Viewer, check the following:
1. Check if the Images folder contains all the necessary images of the document. If they aren't, manually add the images using Sigil.
2. Double-click the XHTML files in the Text folder and correct the path of the images if needed.
To check if your EPUB is valid, click Tools on the toolbar then Validate With EPUB FlightCrew. Unlike the EPUB I created using Calligra and LyX, the EPUB produced from the Docbook XML EPUB stylesheets had only one error regarding the format of the date (the metadata required the yyyy-mm-dd format).
Testing in Okular and Calibre
Open the EPUB file using an ebook reader to check if the images and formatting are consistent. The Docbook XML document converted to EPUB in this example opened properly in Calibre E-Book Viewer and EPUBViewer for Mozilla Firefox, complete with an accurate Table of Comments and proper Docbook formatting. Okular, KDE's document viewer, isn't a dedicated ebook viewer so added unnecessary bullet points in the Package Contents section. However, issues didn't appear when viewed in iOS iBooks and using Android apps.
0 comments:
Post a Comment