-
Notifications
You must be signed in to change notification settings - Fork 405
Library
You can use EPUBCheck as a library in your Java application. EPUBCheck public interfaces can be found in the com.adobe.epubcheck.api
package. The EPUBCheck
class can be used to instantiate a validation engine. Use one of its constructors and then call validate()
method.
Basic example (snippet):
File epubFile = new File("/path/to/your/epub/file.epub");
// simple constructor; errors are printed on stderr stream
EpubCheck epubcheck = new EpubCheck(epubFile);
// validate() returns true if no errors or warnings are found
boolean result = epubcheck.validate();
Report
is an interface that you can implement to get a list of the errors and warnings reported by the validation engine (instead of the error list being printed out on stderr
). See also how to customize the validation report.
The default ZIP distribution contains all you need to use EPUBCheck as a library.
EPUBCheck jar
releases are available in the Maven Central Repository.
To use it as a library in your project, use the dependency information matching your build tool
<dependency>
<groupId>org.w3c</groupId>
<artifactId>epubcheck</artifactId>
<version>4.2.4</version>
</dependency>
'org.w3c:epubcheck:jar:4.2.4'
<dependency org="org.w3c" name="epubcheck" rev="4.2.4" />
compile group: 'org.w3c', name: 'epubcheck', version: '4.2.4'
compile 'org.w3c:epubcheck:4.2.4'
libraryDependencies += "org.w3c" % "epubcheck" % "4.2.4"