Options
All
  • Public
  • Public/Protected
  • All
Menu

Describes a source PDF publication that can be loaded into a ReadingSystemEngine. Uses pdf.js for parsing and rendering the PDF document.

Hierarchy

  • PdfPublication

Implements

Index

Constructors

constructor

Methods

destroy

  • destroy(): void
  • Destroy this instance, allowing used resources to be garbage collected.

    Returns void

getDefaultLayout

getHashSignature

  • getHashSignature(): string
  • 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

getMediaType

getMetadata

getPageProgressionDirection

getPreferredFlowMode

getPreferredOrientation

getPreferredSyntheticSpreadBehavior

getSpine

getType

  • 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

isDestroyed

  • isDestroyed(): boolean

toJSON

Static createFromArrayBuffer

  • Creates a new PdfPublication from an ArrayBuffer containing the PDF file data.

    If the PDF is password protected, you must also provide a password in the passed options object. Otherwise, the returned Promise is rejected with a PdfPublicationError with errorType set to PASSWORD_REQUIRED. If an incorrect password is provided, the errorType is set to PASSWORD_INCORRECT.

    Parameters

    Returns Promise<IPdfPublication>

Static createFromBlob

  • Creates a new PdfPublication from a Blob containing the PDF file data.

    If the PDF is password protected, you must also provide a password in the passed options object. Otherwise, the returned Promise is rejected with a PdfPublicationError with errorType set to PASSWORD_REQUIRED. If an incorrect password is provided, the errorType is set to PASSWORD_INCORRECT.

    Parameters

    Returns Promise<IPdfPublication>

Static createFromRandomAccessDataSource

  • Creates a new PdfPublication from a IRandomAccessDataSource implementation returning chunks of PDF file data. Using this method, the framework will download only the requested portions of the publication, thus minimizing load times and data usage.

    If the PDF is password protected, you must also provide a password in the passed options object. Otherwise, the returned Promise is rejected with a PdfPublicationError with errorType set to PASSWORD_REQUIRED. If an incorrect password is provided, the errorType is set to PASSWORD_INCORRECT.

    Parameters

    Returns Promise<IPdfPublication>

Generated using TypeDoc