epubcheck用法(转)
2015-10-16 11:17
447 查看
Running
Tobias Fischer edited this page on 2 Sep ·8 revisions
EpubCheck is a command line tool, all detected errors are simply printed to
stderroutput stream.
There's no native GUI – however, there are some thirdparty apps offering a GUI. See theGUI wiki page for further details.
System prerequisites
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!
Running from the command line
Validating a packaged EPUB
java -jar epubcheck.jar file.epub
Specifying a validation profile
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 profile
dict: validates against the
EPUB Dictionaries and Glossaries specification
edupub: validates against the
EDUPUB Profile
idx: validates against the
EPUB Indexes specification
preview: validates against the
EPUB Previews specification
Note: In most cases, it is not required to specify the validation profile explicitly, as it will automatically be set according to
dc:typemetadata in the Publication. Setting the profile explicitly can be useful to detect when such
dc:type
metadata is missing, or to validate single files (see next section).
Validating a single file
java -jar epubcheck.jar singleFile -mode MODE -v VERSION -profile PROFILE
MODE must be one of the following:
opffor package document validation;
navfor navigation document validation (available only for version 3.0);
mofor media overlay validation (available only for version 3.0);
xhtml;
svg;
expfor 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.
Validating an "expanded" (i.e. unzipped) EPUB
java -jar epubcheck.jar folder/ -mode exp [-save]
When using expanded mode, there's an optional flag
-saveto save the created archive upon validation.
Additional flags
-out file.xmloutputs an assessment XML document
-quietor
-qoutputs only if there is any warning or error
-help,
--helpor
-?displays a help message
转自:https://github.com/IDPF/epubcheck/wiki/Running
epubcheck项目地址:https://github.com/IDPF/epubcheck
相关文章推荐
- C#简单的向量用法实例教程
- Lua函数用法研究
- C#中Forms.Timer、Timers.Timer、Threading.Timer的用法分析
- Mysql之SQL Mode用法详解
- C#中sizeof的用法实例分析
- c#中Empty()和DefalutIfEmpty()用法分析
- C#中的ICustomFormatter及IFormatProvider接口用法揭秘
- C++ Vector用法详解
- C语言循环结构与时间函数用法实例教程
- MFC中Radio Button的用法详解
- C语言中char*和char[]用法区别分析
- C#中is和as用法实例分析
- C#调用SQL语句时乘号的用法
- PHP strtotime函数用法、实现原理和源码分析
- PHP中ini_set与ini_get用法实例
- PHP Session机制简介及用法
- smarty缓存用法分析
- C#属性(Attribute)用法实例解析
- scrollTop 用法说明
- javascript中call和apply的用法示例分析