EpubCheck is a tool to validate EPUB files. It can detect many types of errors in EPUB. OCF container structure, OPF and OPS mark-up, and internal reference consistency are checked. EpubCheck can be run as a standalone command-line tool or used as a Java library.
Décompresser le fichier .epub
$ unzip test.epub -d test $ ls -1 test/* test/ch001.xhtml test/content.opf test/mimetype test/nav.xhtml test/stylesheet.css test/title_page.xhtml test/toc.ncx
test/META-INF: com.apple.ibooks.display-options.xml container.xml
Apporter les modifications nécesssaires et, si le résultat est valide, effectuer
$ epubcheck ./test -mode exp -save
Il est indispensable de préciser le répertoire avec le point initial ! Faute de quoi:
java.lang.RuntimeException: The path specified for the archive is invalid
Cf. http://www.ibm.com/developerworks/xml/tutorials/x-epubtut/index.html?ca=drs-
$ zip -0Xq my-book.epub mimetype $ zip -Xr9Dq my-book.epub *