epubcheck用法(转)

epubCheck是一款用于验证EPUB文件的命令行工具,支持多种验证模式和配置文件,适用于各种操作系统。该工具需要Java环境运行,并提供详细的系统预设要求,包括Java版本和操作系统的兼容性说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Running

Tobias Fischer edited this page on 2 Sep · 8 revisions

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.

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:

Note: 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).

Validating a single file

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.

Validating an "expanded" (i.e. unzipped) EPUB

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.

Additional flags

  • -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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值