com.groupdocs.parser

Interfaces

Classes

Exceptions

com.groupdocs.parser

Class EpubPackage

  • All Implemented Interfaces:
    IPageTextExtractor


    public final class EpubPackage
    extends Object
    implements IPageTextExtractor

    Provides the information of a EPUB package.

    Package contains content documents. For example, each chapter is contained in a separated content document. Count property returns a total number of content documents in the package:

     int documentCount = epubPackage.getCount();
      

    To extract a text from content document ExtractItem method is used:

     String text = epubPackage.extractItem(0);
      
    • Method Detail

      • getCount

        public int getCount()

        Gets a total number of content documents.

        Returns:
        A total number of content documents.
      • get_Item

        public String get_Item(int index)

        Gets a path to the content document file.

        Parameters:
        index - An index of the content document.
        Returns:
        A string that contains the path to the content document file.
      • getTableOfContents

        public List<TableOfContentsItem> getTableOfContents()

        Gets a collection of table of contents items.

        Returns:
        A collection of table of contents items.
      • extractItem

        public String extractItem(int itemIndex)

        Extracts a text form the content document.

        Parameters:
        itemIndex - An index of the content document.
        Returns:
        A string that contains all characters from content document.
      • extractPage

        public String extractPage(int pageIndex)

        Extracts all characters from the page with pageIndex and returns the data as a string.

        Specified by:
        extractPage in interface IPageTextExtractor
        Parameters:
        pageIndex - The index of the page.
        Returns:
        A string that contains all characters from the page, or null if all characters have been extracted.