C# Class nl.siegmann.epublib.epub.PackageDocumentReader

Reads the opf package document as defined by namespace http://www.idpf. org/2007/opf
Inheritance: PackageDocumentBase
Afficher le fichier Open project: lanfengqi/EpubLib-Sharp Class Usage Examples

Méthodes publiques

Méthode Description
read ( Resource packageResource, EpubReader epubReader, Book book, Resources resources ) : void

Private Methods

Méthode Description
findCoverHrefs ( System.Xml.Linq.XElement packageDocument ) : List

package

findTableOfContentsResource ( System.Xml.Linq.XElement spineElement, Resources resources ) : Resource

The spine tag should contain a 'toc' attribute with as value the resource id of the table of contents resource. Here we try several ways of finding this table of contents resource. We try the given attribute value, some often-used ones and finally look through all resources for the first resource with the table of contents mimetype.

fixHrefs ( String packageHref, Resources resourcesByHref ) : Resources

Strips off the package prefixes up to the href of the packageHref. Example: If the packageHref is "OEBPS/content.opf" then a resource href like "OEBPS/foo/bar. html" will be turned into "foo/bar.html"

generateSpineFromResources ( Resources resources ) : Spine

Creates a spine out of all resources in the resources. The generated spine consists of all XHTML pages in order of their href.

readCover ( System.Xml.Linq.XElement packageDocument, Book book ) : void

Finds the cover resource in the packageDocument and adds it to the book if found. Keeps the cover resource in the resources map

readGuide ( System.Xml.Linq.XElement packageDocument, EpubReader epubReader, Book book, Resources resources ) : void

Reads the book's guide. Here some more attempts are made at finding the cover page.

readManifest ( System.Xml.Linq.XElement packageDocument, String packageHref, EpubReader epubReader, Resources resources, String>.Dictionary idMapping ) : Resources

Reads the manifest containing the resource ids, hrefs and mediatypes.

readSpine ( System.Xml.Linq.XElement packageDocument, EpubReader epubReader, Resources resources, String>.Dictionary idMapping ) : Spine

Reads the document's spine, containing all sections in reading order.

Method Details

read() public static méthode

public static read ( Resource packageResource, EpubReader epubReader, Book book, Resources resources ) : void
packageResource nl.siegmann.epublib.domain.Resource
epubReader EpubReader
book nl.siegmann.epublib.domain.Book
resources nl.siegmann.epublib.domain.Resources
Résultat void