GemBox.PdfViewer
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    GemBoxPdfViewer Class

    Namespace:
    @gembox/pdfviewer
    Assembly:
    @gembox/pdfviewer

    Represents the main PDF viewer class that provides functionality for displaying and interacting with PDF documents.

    • TypeScript
    export declare class GemBoxPdfViewer
    Inheritance:
    GemBoxPdfViewer

    Fields

    features

    Gets the features available in the PDF viewer.

    • TypeScript
    readonly features: Features;
    Field Value
    Features
    Remarks

    This property provides access to various features such as annotations, digital signing, zoom, page navigation, and search functionality.

    ui

    Gets the user interface components of the PDF viewer.

    • TypeScript
    readonly ui: UI;
    Field Value
    UI
    Remarks

    This property provides access to UI elements like theme, toolbar, and side panel configuration.

    Methods

    open(string | Uint8Array | ArrayBuffer)

    Opens a PDF document for viewing.

    • TypeScript
    open(document: string | Uint8Array | ArrayBuffer): Promise<void>;
    Parameters
    document

    The PDF document to open, which can be a string (URL or base64), Uint8Array, or ArrayBuffer.

    Remarks

    This method loads the specified PDF document into the viewer. The document can be provided as:

    • A URL string pointing to a PDF file.
    • A base64 encoded string representing the PDF content.
    • A Uint8Array containing the raw PDF bytes.
    • An ArrayBuffer containing the raw PDF data.

    setLicense(string)

    Sets the license (serial) key for the GemBox.PdfViewer.

    • TypeScript
    static setLicense(licenseKey: string): void;
    Parameters
    licenseKey

    The serial key to use for licensing.

    Remarks

    You should call this method before creating any PDF Viewer instance. Key can only be set once (if you try to set another key, it will be ignored). The best place to call this method is during application initialization, before calling GemBoxPdfViewer.create(). Valid serial key has multiple groups of alphanumeric characters, separated with dashes. To use the assembly in free limited mode, use FREE-LIMITED-KEY as licenseKey.

    create(ViewerOptions)

    Creates a new instance of the PDF viewer and initializes it with the specified options.

    • TypeScript
    static create(options: ViewerOptions): Promise<GemBoxPdfViewer>;
    Parameters
    options
    ViewerOptions

    The configuration options for the PDF viewer.

    Remarks

    This static method creates and initializes a new PDF viewer instance. It:

    • Validates the license key.
    • Sets up the Vue application.
    • Initializes worker threads for PDF processing.
    • Mounts the viewer to the specified container element.
    • The options parameter allows you to configure various aspects of the viewer including UI elements, features, and initial document.

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.