ComPDFKit Web SDK
    Preparing search index...

    Function loadDocument

    • Loads a document into the active viewer, or into the viewer with the given key. Resets the UI, asks for a password when needed, shows the loading overlay and recovers from errors. Rejects on an invalid key or arguments.

      Parameters

      • src: DocumentSource | Document

        The document source (URL, File, Blob, ArrayBuffer...) or a loaded Document.

      • Optionaloptions: UILoadDocumentOptions

        Load options.

      • OptionaldocumentViewerKey: number

        The viewer key; the active viewer by default.

      Returns Promise<void>

      A Promise that resolves when the document is loaded.

      await instance.UI.loadDocument('https://example.com/sample.pdf', { filename: 'sample.pdf' });