GemBoxPdfViewer Class
Represents the main PDF viewer class that provides functionality for displaying and interacting with PDF documents.
export declare class GemBoxPdfViewer
- Inheritance:
-
GemBoxPdfViewer
Fields
features
Gets the features available in the PDF viewer.
readonly features: Features;
Field Value
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.
readonly ui: UI;
Field Value
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.
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.
static setLicense(licenseKey: string): void;
Parameters
-
licenseKey
The serial key to use for licensing.
Remarks
GemBoxPdfViewer.create().FREE-LIMITED-KEY as licenseKey.
create(ViewerOptions)
Creates a new instance of the PDF viewer and initializes it with the specified options.
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.