Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Web Publication implementation of IPublication that can be loaded into the Reading System.

    To create an instance, use one of the static methods:

    • createFromBlob
    • createFromPrimaryEntryPageUrl
    • createFromManifestUrl
    • createFromRandomAccessDataSource

    Implements

    Constructors

    Methods

    • Destroy this instance, allowing used resources to be garbage collected.

      Returns void

    • Get the URL to the cover image resource declared in this publication, if any.

      To fetch the resource data for this URL, use the IResourceProvider returned by getBackingResourceProvider().

      Returns URL

    • Get a generated hash signature of the publication, intended to uniquely identify this publication. The hash signature is not the same as the publication id as the hash signature always changes when the publication data changes in any way. The uniqueness of the signature depends on how the publication was loaded. Please refer the implementation responsible for loading this instance. For example, for EPUB see OcfResourceProvider.

      Returns string

    • Get the URL to the resource containing the navigation structure for this publication, if any.

      Returns URL

    • Get the profile of this publication.

      Profiles are publication formats (e.g., audiobooks) describing what type of contents to expect in the publication and in the manifest data.

      Returns string[]

    • Get the type of publication this instance represents.

      This allows you to cast an IPublication instance to a more specific subtype. See PublicationType for how values map to specific IPublication types.

      Returns PublicationType

    • If this Publication instance has been destroyed.

      Returns boolean

    • Creates a new instance from a blob containing the LPF file.

      Parameters

      • blob: Blob

        The complete LPF file as a blob.

      Returns Promise<IWpPublication>

    • Creates a new instance by loading the publication from the specified IResourceProvider instance and publication manifest URL.

      Parameters

      • resourceProvider: IResourceProvider

        The resource provider where to fetch resources from.

      • manifestUrl: string | URL

        An absolute or relative URL identifying the manifest of the publication.

      • hashSignature: string

        A string uniquely identifying this version of the publication. This can for example be a SHA checksum of the publication contents.

      • OptionalonDestroyed: () => void

        A function that will be called when WpPublication.destroy() has been called. This allows for cleaning up ResourceProviders etc.

      Returns Promise<IWpPublication>

    • Creates a new instance by loading the publication from the specified IResourceProvider instance and primary entry page URL.

      Parameters

      • resourceProvider: IResourceProvider

        The resource provider where to fetch resources from.

      • primaryEntryPageUrl: string | URL

        An absolute or relative URL identifying the primary entry page of the publication. See https://www.w3.org/TR/wpub/#primary-entry-page for more information

      • hashSignature: string

        A string uniquely identifying this version of the publication. This can for example be a SHA checksum of the publication contents.

      • OptionalonDestroyed: () => void

        A function that will be called when WpPublication.destroy() has been called. This allows for cleaning up ResourceProviders etc.

      Returns Promise<IWpPublication>

    • Creates a new instance from a IResourceProvider representing the LPF file container.

      The implementation will look for the Publication Manifest by trying to fetch first publication.json and then index.html.

      Parameters

      • resourceProvider: IResourceProvider

        The resource provider where to fetch resources from.

      • hashSignature: string

        A string uniquely identifying this version of the publication. This can for example be the SHA1 hash of the publication contents.

      • OptionalonDestroyed: () => void

        A function that will be called when WpPublication.destroy() has been called. This allows for cleaning up ResourceProviders etc.

      Returns Promise<IWpPublication>