ComPDFKit Web SDK
    Preparing search index...

    Type Alias UILoadDocumentOptions

    UILoadDocumentOptions: {
        customHeaders?: Record<string, string>;
        documentId?: string;
        extension?: string;
        filename?: string;
        onError?: (error: ComPDFKitError) => void;
        onLoadingProgress?: (percent: number) => void;
        password?: string | ((checkPassword: (password: string) => void) => void);
        signal?: AbortSignal;
        withCredentials?: boolean;
    } & { docId?: string }

    Options of UI.loadDocument: the core document loading options, without the license key (the viewer's license is used).

    Type Declaration

    • OptionalcustomHeaders?: Record<string, string>

      Request headers for URL sources

    • OptionaldocumentId?: string

      Business id of the document (Document.getDocumentId(), the argument of setDocumentXFDFRetriever)

    • Optionalextension?: string

      An explicitly passed non-pdf type is rejected before reading; the format is decided by the file header

    • Optionalfilename?: string

      Takes precedence over the file name inferred from the source

    • OptionalonError?: (error: ComPDFKitError) => void

      On load failure, called back first, then rejects

    • OptionalonLoadingProgress?: (percent: number) => void

      0–1, (download progress + Worker load progress) / 2, never decreasing; reports 1 exactly once at the end on success

    • Optionalpassword?: string | ((checkPassword: (password: string) => void) => void)

      A wrong string reports PASSWORD_REQUIRED; the function form can ask repeatedly

    • Optionalsignal?: AbortSignal

      Aborts the load when signaled.

    • OptionalwithCredentials?: boolean

      Send cookies for cross-origin URL sources

    • OptionaldocId?: string

      Another name for documentId; used when documentId is not given.