PDF Web Viewer
    Preparing search index...

    Interface IPdfEditorResult

    Result object returned from PDF editor initialization.

    This is the main return type from PdfEditor function. It provides access to:

    • UI elements and services for managing document views
    • The initialized SDK for headless PDF operations
    const result = await PdfEditor({ container, license: 'your-key' });

    // Access UI components
    const { pdfWebElement, pdfWebService } = result.ui;

    // Use SDK for document operations
    const document = await result.sdk.openDocument({ file: pdfFile });

    Headless Mode: Users can work with PDFs without the UI by using the sdk field:

    const result = await PdfEditor({ container, license: 'your-key' });
    const document = await result.sdk.openDocument({ file: pdfFile });

    Alternatively, users can use PdfSdk directly from '@avanquest/pdf-web-viewer/sdk'. In this case, PdfSdk.initialize must be called manually before any operations:

    import { PdfSdk } from '@avanquest/pdf-web-viewer/sdk';

    await PdfSdk.initialize({ license: 'your-key', workerPath: '/workers' });
    const document = await PdfSdk.openDocument({ file: pdfFile });
    interface IPdfEditorResult {
        error?: Error;
        isLoading?: boolean;
        sdk: IPdfSdk;
        ui: {
            pdfWebElement: IDocumentViewerWrapperElement;
            pdfWebService: IDocumentViewService;
        };
    }
    Index

    Properties

    Properties

    error?: Error

    Error that occurred during initialization, if any.

    isLoading?: boolean

    Loading state indicator.

    sdk: IPdfSdk

    The initialized PDF SDK instance. Use this for headless PDF operations such as:

    • Opening documents: result.sdk.openDocument({ file })
    • Creating blank documents: result.sdk.openBlankDocument()
    • Listing system fonts: result.sdk.listSystemFonts()
    • Registering user fonts: result.sdk.registerUserFonts(fonts)

    The SDK is already initialized when returned from PdfEditor().

    ui: {
        pdfWebElement: IDocumentViewerWrapperElement;
        pdfWebService: IDocumentViewService;
    }

    UI components for the PDF editor.

    Type declaration

    • pdfWebElement: IDocumentViewerWrapperElement

      The PDF editor wrapper element. This element contains the document view and UI controls. When hideToolsPanel: true is set, the toolbar and panels are hidden but the wrapper element is still used for consistent API.

    • pdfWebService: IDocumentViewService

      Service for managing document view instances. Use this service to:

      • Get the primary document view element
      • Access document view state and configuration
      • Control document rendering and display