Working with metadata in EPUB e-books

What is EPUB?

EPUB is an e-book file format that uses the “.epub” file extension. EPUB is supported by many e-readers, and compatible software is available for most smartphones, tablets, and computers. 

Reading EPUB format-specific properties

The GroupDocs.Metadata API supports extracting format-specific information from EPUB files.

The following are the steps to read native EPUB metadata.

  1. Load an EPUB file
  2. Get the root metadata package
  3. Extract  the native metadata package using the EpubRootPackage.getEpubPackage method
  4. Read the EPUB metadata properties


try (Metadata metadata = new Metadata(Constants.InputEpub)) {
	EpubRootPackage root = metadata.getRootPackageGeneric();

	System.out.println(root.getEpubPackage().getImageCover() != null ? root.getEpubPackage().getImageCover().length : 0);

Reading Dublin Core Metadata

Dublin Core metadata is a set of certain metadata properties that are intended to describe various digital resources. Please find more information on the Dublin Core standard at The code sample below shows how to extract Dublin Core metadata from a EPUB e-book using the GroupDocs.Metadata API.


try (Metadata metadata = new Metadata(Constants.InputEpub)) {
	EpubRootPackage root = metadata.getRootPackageGeneric();

	if (root.getDublinCorePackage() != null) {

		// ...

Please see the the DublinCorePackage class to get more information on supported Dublin Core metadata properties.

More resources

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free online document metadata management App

Along with full featured Java library we provide simple, but powerful free Apps.

You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online Free Online Document Metadata Viewing and Editing App.