PDF Web Viewer
    Preparing search index...

    Interface ISetupOptions

    Configuration options for initializing the PDF Editor.

    const result = await PdfEditor({
    license: 'your-license-key',
    container: document.getElementById('editor'),
    basePath: '/app', // only if hosted under example.com/app/, omit for the domain root
    onError: (error) => console.error(error),
    });
    interface ISetupOptions {
        apiAuthMode?: ApiAuthMode;
        apiToolsHeaders?:
            | Record<string, string>
            | (() => Record<string, string> | Promise<Record<string, string>>);
        apiToolsUrl?: string;
        basePath?: string;
        brandingConfig?: IBrandingConfig;
        container?: HTMLElement;
        customProviders?: ICustomFilesProvider[];
        defaultFont?: IDefaultFontConfig;
        defaultPageView?: PdfPageView;
        deviceConfig?: IDeviceConfig;
        disableDefaultNotifications?: boolean;
        dropboxConfig?: IDropboxConfig;
        googleDriveConfig?: IGoogleDriveConfig;
        hideToolsPanel?: boolean;
        initialDocument?: IOpenDocumentOptions;
        languageConfig?: ILanguageConfig;
        layoutConfig?: ILayoutConfig;
        license: string;
        onActivity?: IActivityCallback;
        onAddSignature?: (appearanceType: AppearanceType) => void;
        onConfigChange?: (config: IConfigChangeData) => void;
        onContextMenuRequested?: IContextMenuRequestedCallback;
        oneDriveConfig?: IOneDriveConfig;
        onError?: (error: Error) => void;
        onESignFieldEditRequested?: IESignFieldEditRequestedCallback;
        onESignFieldFillRequested?: IESignFieldFillRequestedCallback;
        onESignSignRequested?: IESignSignRequestedCallback;
        onExportFile?: (file: File) => void;
        onLoadingStateChange?: (isLoading: boolean) => void;
        onOpenFile?: () => Promise<void>;
        onOperationRequested?: IOperationRequestedCallback;
        onPasswordRequired?: IPasswordRequiredCallback;
        onPrint?: (file: File, newTab?: boolean) => void;
        onRemoveSignatureRequested?: IRemoveSignatureRequestedCallback;
        onSnapshotArea?: (blob: Blob) => void;
        openDocumentsInNewTab?: boolean;
        openFormatsConfig?: IOpenFormatsConfig;
        recentsConfig?: IRecentsConfig;
        themeConfig?: IThemeConfig;
        translateConfig?: ITranslateConfig;
        unitsAndGuides?: IUnitsAndGuidesConfig;
        userFonts?: IUserFontData;
        userInitial?: AppearanceModel[];
        userManagementConfig?: IUserManagementConfig;
        userName?: string;
        userSignature?: AppearanceModel[];
    }
    Index

    Properties

    apiAuthMode?: ApiAuthMode

    How calls to apiToolsUrl are authenticated. Defaults to 'apiKey'.

    apiToolsHeaders?:
        | Record<string, string>
        | (() => Record<string, string> | Promise<Record<string, string>>)

    Extra HTTP headers merged into every call to apiToolsUrl, applied after the apiAuthMode auth header so these can override it. Only needed by integrators who route these calls through their own infrastructure via apiToolsUrl — e.g. to attach a gateway token or a tenant header.

    Pass a plain object for static headers, or a function for values that can go stale (it is called fresh before every request, and may return a Promise).

    apiToolsUrl?: string

    Base URL for the Avanquest Developers API (translate, OCR, convert). Defaults to 'https://api-developers.avanquest.com'.

    basePath?: string

    URL prefix under which the pwv-* static asset folders (worker, fonts, i18n, cursors, stamps) are served, e.g. '/app' when hosting at example.com/app/pwv-workers, example.com/app/pwv-fonts, etc. Defaults to the domain root ('') - copy the package's public/pwv-* folders there, or set this to match wherever you host them.

    brandingConfig?: IBrandingConfig

    Branding customization (logo, colors, etc.).

    container?: HTMLElement

    DOM element to render the editor into.

    customProviders?: ICustomFilesProvider[]

    Host-owned storage sources ("bring your own cloud"), shown on the empty ("home") screen as extra tabs next to "Recents" and the built-in drives.

    Each entry is always visible and needs no sign-in — the host app already knows the user — and its body is a folder browser with a breadcrumb, driven by ICustomFilesProvider.listFolder. Entries with a missing/duplicate id or non-callable listFolder/getFileAsFile are skipped with a console error. Hide them all with layoutConfig.chooseFile.customProviders: false.

    defaultFont?: IDefaultFontConfig

    Default font configuration.

    defaultPageView?: PdfPageView

    Initial zoom/fit mode applied to every document on open (unless the open call specifies its own). Defaults to PdfPageView.fitWidth on narrow viewports (<1024px) and PdfPageView.fitPage otherwise.

    deviceConfig?: IDeviceConfig

    "This device" as a save target. It works without this — the document leaves through the export (ISetupOptions.onExportFile) unless this config implements the writing. See IDeviceConfig.

    disableDefaultNotifications?: boolean

    Disable default notifications.

    dropboxConfig?: IDropboxConfig

    Dropbox integration. When defined with a clientId (Dropbox app key), the viewer shows a "Dropbox" card on the empty ("home") screen; the end user connects their Dropbox account and the card lists their recent Dropbox PDFs and lets them browse folders. Clicking a file opens it in the clicked pane. See IDropboxConfig.

    googleDriveConfig?: IGoogleDriveConfig

    Google Drive integration. When defined with a clientId, the viewer shows a "Google Drive" card on the empty ("home") screen; the end user connects their Google account and the card lists their recent Drive PDFs and lets them browse folders. Clicking a file opens it in the clicked pane. See IGoogleDriveConfig.

    hideToolsPanel?: boolean

    If true, hides the tools panel on startup.

    initialDocument?: IOpenDocumentOptions

    Initial document to open upon initialization. Note: The file property must be a valid File object.

    languageConfig?: ILanguageConfig

    Language and localization settings.

    layoutConfig?: ILayoutConfig

    Layout customization options.

    license: string

    Your PDF Editor license key (required).

    onActivity?: IActivityCallback

    Callback invoked once per discrete UI activity event — a tool activated, a dialog opened/closed, a header tab switched, a menu action invoked, and so on. Use it to feed the host's analytics. Events are structured (IActivityEvent) and delivered on a microtask; errors thrown by the callback are swallowed and never affect the viewer. When omitted, no tracking work is done at all (zero overhead).

    onAddSignature?: (appearanceType: AppearanceType) => void

    Callback when adding signature or initials.

    onConfigChange?: (config: IConfigChangeData) => void

    Callback when configuration changes.

    onContextMenuRequested?: IContextMenuRequestedCallback

    Callback invoked on right-click within the document, before the built-in context menu opens. Receives the context menu type and the click position relative to the document render element. Return true after showing your own menu to suppress the default one; return false to fall back.

    oneDriveConfig?: IOneDriveConfig

    OneDrive (Microsoft Graph) integration. When defined with a clientId, the viewer shows a "OneDrive" card on the empty ("home") screen; the end user connects their OneDrive account and the card lists their recent OneDrive PDFs and lets them browse folders. Clicking a file opens it in the clicked pane. The library performs the OAuth flow itself using the integrator-provided app credentials. See IOneDriveConfig.

    onError?: (error: Error) => void

    Callback when an error occurs.

    onESignFieldEditRequested?: IESignFieldEditRequestedCallback

    Callback invoked when an already-placed E-Sign field is double-clicked in edit mode. Return true after handling the edit with your own UI to skip the library's default behavior; return false to fall back.

    onESignFieldFillRequested?: IESignFieldFillRequestedCallback

    Callback invoked when an E-Sign field needs a signature-capture modal (Signature / Initials / Certify / DigitalSignature). Return true after applying the value yourself to skip the library's default dialog; return false to fall back. Not invoked for in-place text editors (TextInput, DropDown, Name, Company, Title, Email, Date) or click-toggles (CheckBox, RadioButton).

    onESignSignRequested?: IESignSignRequestedCallback

    Callback invoked when the signer presses the E-Sign toolbar's Sign button. Resolve with the signed File to plug in your own signing service; resolve with null to cancel. Required-field validation runs before this callback fires.

    onExportFile?: (file: File) => void

    Every file the viewer hands over: the document on Download, and each generated artefact (converted file, extracted images, split or compressed result, attachment, form data, snapshot). One-way on purpose — it delivers a copy and reports nothing back.

    Saving is not this: a save writes to a target and has to say whether it worked, which is deviceConfig.saveOver / saveInto for the machine and the provider itself for a cloud. The one overlap is the device's fallback: with no deviceConfig write methods, saving to "This device" is an export, so it arrives here too.

    onLoadingStateChange?: (isLoading: boolean) => void

    Callback when loading state changes.

    onOpenFile?: () => Promise<void>

    Callback to handle 'Open File' action.

    onOperationRequested?: IOperationRequestedCallback

    Callback invoked before each document operation. Return false to deny the operation.

    onPasswordRequired?: IPasswordRequiredCallback

    Callback when a password is required for a protected PDF.

    onPrint?: (file: File, newTab?: boolean) => void

    Callback when printing.

    onRemoveSignatureRequested?: IRemoveSignatureRequestedCallback

    Callback invoked when the user requests to remove all signatures. Override to provide a custom confirmation dialog.

    onSnapshotArea?: (blob: Blob) => void

    Callback when a snapshot area is captured.

    openDocumentsInNewTab?: boolean

    If true (default), each opened document gets its own tab. If false, the new document replaces the current view.

    openFormatsConfig?: IOpenFormatsConfig

    Extra file formats the open UI should offer, on top of the ones the viewer reads itself. Only widens what the picker and the cloud listings let the user choose — opening such a file is yours to handle, via onOpenFile. See IOpenFormatsConfig for the built-in list and what happens to a declared format that is not converted.

    recentsConfig?: IRecentsConfig

    Storage for the recent-documents history. The viewer keeps the history itself and shows it on the empty ("home") screen; this only makes it outlive a page reload. See IRecentsConfig.

    themeConfig?: IThemeConfig

    Theme configuration (light/dark mode, colors).

    translateConfig?: ITranslateConfig

    Translate workflow configuration.

    unitsAndGuides?: IUnitsAndGuidesConfig

    Units and guides (ruler, grid) configuration.

    userFonts?: IUserFontData

    Custom fonts to make available in the editor.

    userInitial?: AppearanceModel[]

    Pre-defined initials for Fill & sign.

    userManagementConfig?: IUserManagementConfig

    User management configuration (login, logout, account URLs and user info).

    userName?: string

    Display name of the current user for annotations.

    userSignature?: AppearanceModel[]

    Pre-defined signatures for Fill & sign.