EpubCheck is a command line tool, all detected errors are simply printed to stderr
output stream.
There's no native GUI – however, there are some thirdparty apps offering a GUI. See theGUI wiki page for further details.
To run the tool you need Java (1.6 or above, 1.7+ recommended). Any Operating System should do.
Note on Java:
You need at least JRE or JDK 1.6 to run EpubCheck on the commandline. However, starting with EpubCheck 4.0 werecommend Java 1.7 or 1.8 to be able to run advanced image checks (Java 1.6 doesn't support those).
Note on Java on Mac OS X:
Due to the change in ownership of the Apple Java version from Apple to Oracle, Java 1.6 (Apple) and Java 1.7+ (Oracle) are kind of incompatible to each other. To run EpubCheck with advanced image checks in a Mac OS X Terminal, theOracle JDK 1.7+ is required!
java -jar epubcheck.jar file.epub
It is possible to specify a validation profile to validate an EPUB (or single file thereof) against a specific IDPF specification.
java -jar epubcheck.jar file.epub -profile PROFILE
Current profiles include:
default
: the default validation profiledict
: validates against the EPUB Dictionaries and Glossaries specificationedupub
: validates against the EDUPUB Profileidx
: validates against the EPUB Indexes specificationpreview
: validates against the EPUB Previews specificationNote: In most cases, it is not required to specify the validation profile explicitly, as it will automatically be set according todc:type
metadata in the Publication. Setting the profile explicitly can be useful to detect when suchdc:type
metadata is missing, or to validate single files (see next section).
java -jar epubcheck.jar singleFile -mode MODE -v VERSION -profile PROFILE
MODE must be one of the following:
opf
for package document validation;nav
for navigation document validation (available only for version 3.0);mo
for media overlay validation (available only for version 3.0);xhtml
;svg
;exp
for Expanded EPUB validation (see the next section)VERSION must be one of
2.0
3.0
PROFILE is optional (see the previous section).
Note that when validating a single file, only a subset of the available tests is run. Also, when validating a full EPUB, both mode and version are ignored.
java -jar epubcheck.jar folder/ -mode exp [-save]
When using expanded mode, there's an optional flag -save
to save the created archive upon validation.
-out file.xml
outputs an assessment XML document-quiet
or -q
outputs only if there is any warning or error-help
, --help
or -?
displays a help message转自:https://github.com/IDPF/epubcheck/wiki/Running
epubcheck项目地址:https://github.com/IDPF/epubcheck