Skip to end of metadata
Go to start of metadata
Contents Summary
 

The code in below examples uses some methods defined in Common Utilities.

Extract Metadata from EPUB Documents 

This feature is supported by version 17.3.0 or greater.

Extract Metadata from EPUB using EpubMetadataExtractor

GroupDocs.Parser for .NET comes with EpubMetadataExtractor class. This class provides functionality for extracting the metadata from EPUB documents.

The Recipe

Using GroupDocs.Parser for .NET, the user can extract metadata from EPUB documents. Given steps are needed to be followed:

  • Get file path
  • Create instance of class EpubMetadataExtractor
  • Initialize the metadata object with extractor.ExtractMetadata(filePath)
  • Loop metadata.keys and get metadata properties

The Code

Extract Metadata from EPUB using ComplexMetadataExtractor

EPUB document can contain one or more packages. Each package has its own metadata collection. For working with such metadata, the API provides ComplexMetadataExtractor class. It has ExtractComplexMetadata methods for extracting the complex metadata. The methods return an enumerator for all metadata collections. EpubMetadataExtractor is inherited from ComplexMetadataExtractor class.

The Recipe

To extract metadata using ComplexMetadataExtractor, the following steps are needed to be followed:

  • Get file path
  • Create the instance of class EpubMetadataExtractor
  • Extract all the metadata under each package using extractor.ExtractComplexMetadata(filePath)
  • Loop through each package e-g for getting current package use enumerator.Current and get every package's metadata in an object initialized say, with name metadata 
  • Loop metadata.keys and get metadata properties

The Code

Labels
  • No labels