Vertex Viewer SDK
    Preparing search index...

    Interface VertexDocumentViewer

    interface VertexDocumentViewer {
        config?: Config;
        documentId?: string;
        documentState?: DocumentApiState;
        interactionMode: InteractionMode;
        layers?: DocumentLayersController;
        loadPage: (pageNumber: number) => Promise<void>;
        panByDelta: (delta: Point.Point) => Promise<void>;
        provider: DocumentProvider;
        registerBasicInteractionHandler: (
            interactionHandler: BasicInteractionHandler,
        ) => Promise<Disposable>;
        resizeDebounce: number;
        src?: string;
        zoomTo: (percentage: number) => Promise<void>;
    }
    Index
    config?: Config

    Configuration values for the document viewer. See Config for more information on the available configuration options.

    documentId?: string

    The ID of the loaded Document. This ID is required to enable persistence of annotations. Note that this is different than a File ID within the Vertex Platform, and must be created separately using the /documents endpoints. See https://docs.vertex3d.com/ for more details.

    documentState?: DocumentApiState

    Common state of the current document. This value includes information common to all types of documents, including state like zoom percentage, viewport definition, and offsets.

    interactionMode: InteractionMode

    The interaction mode for the viewer. When set to 'pan', click and drag will pan the document. When set to 'none', no pointer interactions are registered.

    'pan'
    

    Controller for interacting with layers in the currently loaded document. This controller will automatically be created along with the loaded document. Note that the methods available on this controller will only be supported if the underlying document type supports layers.

    loadPage: (pageNumber: number) => Promise<void>

    Loads a specific page of the currently loaded document. Note that any offset applied by panning the document will be reset when loading a new page.

    Type Declaration

      • (pageNumber: number): Promise<void>
      • Parameters

        • pageNumber: number

          The page number to load.

        Returns Promise<void>

    panByDelta: (delta: Point.Point) => Promise<void>

    Pans the currently loaded document by the specified delta. This method will be bounded to the visible portion of the document to ensure at least a portion of the document is always visible, and the canvas does not appear blank.

    Type Declaration

      • (delta: Point.Point): Promise<void>
      • Parameters

        • delta: Point.Point

          The delta to pan the document by.

        Returns Promise<void>

    The provider used to create the document API and renderer.

    new PdfJsProvider()
    
    registerBasicInteractionHandler: (
        interactionHandler: BasicInteractionHandler,
    ) => Promise<Disposable>

    Registers and initializes an interaction handler with the document viewer. Returns a Disposable that should be used to deregister the interaction handler. InteractionHandlers are used to build custom mouse and touch interactions.

    Type Declaration

    resizeDebounce: number

    An optional value that will debounce image updates when resizing this viewer element.

    100
    
    src?: string

    A URI of the document to load when the component is mounted in the DOM tree. Currently only supports URLs for client-side rendering.

    zoomTo: (percentage: number) => Promise<void>

    Zooms the currently loaded document to the specified zoom percentage. This method will automatically adjust existing offsets to maintain the same center point of the document where possible.

    Type Declaration

      • (percentage: number): Promise<void>
      • Parameters

        • percentage: number

          The zoom percentage to set.

        Returns Promise<void>