ePubReader
ePubBook
Methods:
- FindResourceByHref (Href As String) As ePubResource
Tries to find a resource with the given Href.
- FindResourceById (Id As String) As ePubResource
Tries to find a resource with the given Id.
- FindResourcesByMediaType (MediaType As String) As List
Returns all the resources found with the specified media type.
MediaType: A name (e.g. "image/jpeg") or an extension (e.g. ".jpg").
- FixResourceId (Resource As ePubResource)
Checks the Id of the given resource and changes to a unique identifier if it isn't one already.
Properties:
- Contents As List [read only]
Returns a list of all resources of the book that can be reached via the Spine, the Table of Contents or the Guide.
- CoverImage As ePubResource [read only]
Gets the book's cover image.
- CoverPage As ePubResource [read only]
Gets the book's cover page as a resource.
It's an XHTML document containing a link to the cover image.
- Guide As ePubGuide [read only]
Gets the guide. The guide contains references to special sections of the book like colophon, glossary, etc.
- Metadata As ePubMetadata [read only]
Gets the book's metadata (titles, authors, dates, etc).
- NcxResource As ePubResource [read only]
- OpfResource As ePubResource [read only]
- ResourceMap As Map [read only]
Gets a map of the resources that make up this book.
Resources can be xhtml pages, images, xml documents, etc.
- Size As Int [read only]
Gets the number of resources.
- Spine As ePubSpine [read only]
Gets the sections of the book that should be shown if a user reads the book from start to finish.
- TableOfContents As ePubTableOfContents [read only]
Gets the table of contents of the book.
- Title As String [read only]
Gets the first non-blank title from the book's metadata.
ePubGuide
Methods:
- FindReferencesByType (RefTypeName As String) As List
Returns a list of all guide references that have the given type name (ignoring case).
Properties:
- CoverPage As ePubResource [read only]
Gets the book's cover page as a resource.
- CoverReference As ePubGuideReference [read only]
- References As List [read only]
ePubGuideReference
Properties:
- CompleteHref As String [read only]
Returns the resource Href if the FragmentId is blank, otherwise returns the resource Href + "#" + the FragmentId.
- FragmentId As String [read only]
- Resource As ePubResource [read only]
- ResourceId As String [read only]
Gets the Id of the resource referred to.
- Title As String [read only]
- Type As String [read only]
ePubMetadata
Fields:
- DATE_CREATION As Int
- DATE_MODIFICATION As Int
- DATE_PUBLICATION As Int
- DATE_UNKNOWN As Int
Methods:
- FindMetaAttribute (Name As String) As String
- IsAutoGeneratedId As Boolean
Properties:
- Authors As List [read only]
- Contributors As List [read only]
- Dates As Map [read only]
- Descriptions As List [read only]
- FirstTitle As String [read only]
Gets the first non-blank title of the book. Returns "" if no title found.
- Format As String [read only]
- Identifiers As Map [read only]
- Language As String [read only]
- OtherProperties As Map [read only]
- Publishers As List [read only]
- Rights As List [read only]
- Subjects As List [read only]
- Titles As List [read only]
- Types As List [read only]
ePubNavigationEvent
Fields:
- CurrentFragmentId As String
- CurrentResource As ePubResource
- CurrentSpinePos As Int
- IsFragmentChanged As Boolean
- IsResourceChanged As Boolean
- IsSpinePosChanged As Boolean
- OldFragmentId As String
- OldResource As ePubResource
- OldSpinePos As Int
ePubNavigator
Events:
- AfterJump (Event As ePubNavigationEvent)
Methods:
- GoToFirstSpineSection As Int
- GoToLastSpineSection As Int
- GoToNextSpineSection As Int
- GoToPreviousSpineSection As Int
- GoToResHref (Href As String) As Int
- GoToResId (Id As String) As Int
- GoToResource (Resource As ePubResource) As Int
- GoToSpineSection (Position As Int) As Int
Goes to a specific section. Illegal spine positions are silently ignored.
- HasNextSpineSection As Boolean
- HasPreviousSpineSection As Boolean
- Initialize (Book As ePubBook, EventPrefix As String)
- IsInitialized As Boolean
Properties:
- Book As ePubBook [read only]
- CurrentFragmentId As String [read only]
- CurrentResource As ePubResource [read only]
- CurrentSpinePos As Int [read only]
Gets the current position within the spine.
Returns a value < 0 if the current position is not within the spine.
ePubReader
Events:
- Progression (NbOfUnzippedFiles As Int, UnzippedFile As String)
Methods:
- Initialize
- IsInitialized As Boolean
- Read (ePubFile As String) As ePubBook
Reads the specified ePUB file. All resources are loaded into memory.
- ReadWithoutLoading (ePubFile As String, Encoding As String) As ePubBook
Reads the specified ePUB file without loading any resource into memory.
ePubFile: The file to load.
Encoding: The encoding to use for the HTML files (e.g. "UTF-8").
- UnZip (ePubFile As String, DestFolder As String, EventPrefix As String) As Int
ePubResource
Fields:
- MEDIATYPE_DEFAULT_EXTENSION As Byte
- MEDIATYPE_EXTENSIONS As Byte
- MEDIATYPE_NAME As Byte
Methods:
- Close
Tells this resource to release its cached data.
Properties:
- Bitmap As Bitmap [read only]
Gets the contents of the resource as a bitmap. Supports only BMP, JPEG, PNG and GIF formats.
- Data() As Byte [read only]
Gets the contents of the resource as a byte array.
- Href As String [read only]
Gets the location of the resource within the contents folder of the ePub file.
- Id As String [read only]
Gets the unique Id of the resource.
- InputEncoding As String [read only]
Gets the character encoding of the resource (e.g. "UTF-8").
May be empty for non-text resources like images.
- InputStream As InputStream [read only]
Gets the contents of the resource as an InputStream.
- MediaType As Map [read only]
Returns a map containing the extensions and name of this resource's media type.
- Size As Long [read only]
Returns the size of this resource in bytes.
- Text As String [read only]
Gets the contents of the resource as a string. Do not use with non-text contents.
- Title As String [read only]
Returns the title found by scanning the underlying HTML document.
ePubSpine
Methods:
- Get (Index As Int) As ePubResource
Gets the resource at the given index.
- GetIndex (Resource As ePubResource) As Int
Returns the position within the spine of the given resource.
Returns a value < 0 if not found.
Properties:
- References As List [read only]
- Size As Int [read only]
Gets the number of elements in the spine.
- ToCResource As ePubResource [read only]
Gets the resource containing the XML for the table of contents.
ePubSpineReference
Properties:
- Linear As Boolean [read only]
Denotes whether the section is primary or auxiliary.
Usually the cover page has Linear set to False and all the other sections have it set to True.
It's an optional property that readers may ignore.
- Resource As ePubResource [read only]
- ResourceId As String [read only]
Gets the Id of the resource referred to.
ePubTableOfContents
Properties:
- AllUniqueResources As List [read only]
Gets the list of all unique references (unique by href) in the order in which they are referenced to in the table of contents.
- Depth As Int [read only]
Gets the maximum depth of the reference tree.
- ReferenceTree As List [read only]
Gets the reference tree.
- Size As Int [read only]
Gets the total number of references in this table of contents.
ePubToCReference
Properties:
- Children As List [read only]
- CompleteHref As String [read only]
Returns the resource Href if the FragmentId is blank, otherwise returns the resource Href + "#" + the FragmentId.
- FragmentId As String [read only]
- Resource As ePubResource [read only]
- ResourceId As String [read only]
Gets the Id of the resource referred to.
- Title As String [read only]
Author: Paul Siegmann (ePUB), Wrapper: F. Leneuf-Magaud/Informatix