GcDocs PDF Viewer constructor.
root container element or selector pattern used to select the root container element.
Viewer options. @see ViewerOptions for further information.
Product license key.
Gets all document annotations.
Ask the user if he want to leave the page when document is modified. Requires SupportApi.
Ask the user if he want to leave the page when document is modified. Requires SupportApi.
Indicates whether the open document can be edited using SupportApi. Requires SupportApi.
Specifies the current user name. The property is used by Annotation Editor as default value for 'author' field.
Specifies the current user name. The property is used by Annotation Editor as default value for 'author' field. Note, current user name is saved in the browser's local storage and it will be used on the next page reload if userName option is not set.
Gets the file data. Available when keepFileData option is set to true.
Gets the file name that was used to open the document. The file name is determined as follows:
Gets the URL that was used to open the document. Returns an empty string when the document was opened from binary data.
An unique document identifier.
Indicates whether the document has been modified by the user.
Indicates whether the copy buffer contains any data.
Indicates whether the document is loaded into view.
Gets a value indicating whether the active document has any form fields.
Gets a value indicating whether the viewer has a persistent connection to the server.
```javascript if(viewer.hasPersistentConnection) { viewer.listSharedDocuments().then(function(result) {
}); }
Gets a value indicating whether the pdf viewer can redo document changes. Requires SupportApi.
Indicates whether the Reply Tool has been added.
Gets a value indicating whether the pdf viewer can undo document changes. Requires SupportApi.
Determines whether the annotation layer is hidden.
Determines whether the annotation layer is hidden.
Gets a value indicating whether the active document is open in shared mode. Requires SupportApi.
Returns true if notifications suspended by calls to @see:beginUpdate.
Gets or sets the layout mode (0 - Viewer, 1 - AnnotationEditor or 2 - FormEditor).
Gets or sets the layout mode (0 - Viewer, 1 - AnnotationEditor or 2 - FormEditor).
Gets current log level. Available log levels are: 'None', 'Critical', 'Error', 'Warning', 'Information', 'Debug', 'Trace'. Default level is 'None'.
Sets current log level. Available log levels are: 'None', 'Critical', 'Error', 'Warning', 'Information', 'Debug', 'Trace'. Default level is 'None'.
Gets modifications state for active document. Requires SupportApi.
Occurs when a document is opened.
Occurs immediately before the document opens.
The event indicating error.
Default optional content config. An optional content is a collection of graphics that can be made visible or invisible dynamically.
The viewer options.
PDF viewer options.
Gets pages count.
Gets/sets the active page index.
Gets/sets the active page index.
Gets right sidebar object. Use this object if you want to manipulate the right sidebar.
Specifies the rotation in degrees.
Specifies the rotation in degrees.
Document search worker instance. Searches currently opened document for a text.
Returns data storage which can be used to store and retrieve current signature tool settings and images. Please, note, the storage data depends on current user name, @see:currentUserName property
Data storage for the active document.
Gets the SupportApi client. Requires SupportApi.
Defines the layout of the toolbar for different viewer modes: viewer, annotationEditor, formEditor.
Defines the layout of the toolbar for different viewer modes: viewer, annotationEditor, formEditor.
Gets total undo levels count. Requires SupportApi.
Gets current undo level index. Requires SupportApi.
Returns the current version of the GcDocs PDF viewer.
Gets/sets the current zoom node. Accepted values are: 0 - Value, 1 - PageWidth, 2 - WholePage.
// Set zoom mode to 'WholePage'
viewer.zoomMode = 2;
Gets/sets the current zoom node. Accepted values are: 0 - Value, 1 - PageWidth, 2 - WholePage.
Gets/sets the current zoom percentage level.
Gets/sets the current zoom percentage level.
Gets i18next instance which can be used to add viewer translations. See https://www.i18next.com for details about i18next framework.
Add annotation to document. Requires SupportApi.
Add annotation editor panel. Requires SupportApi.
Add articles panel.
Add attachments panel.
Add default set of sidebar panels with default order: 'Thumbnails', 'Search', 'Outline', 'Attachments', 'Articles'
Adds document list panel to the Viewer with available document array specified in documentslist.json file (URL specified by documentListUrl option), located in the root directory of your application. You can specify service at the end point for documentListUrl option. The service should return JSON string with available documents array, e.g.: ["pdf1.pdf", "pdf2.pdf"]
Optional. Document list service URL.
Add form editor panel. Requires SupportApi.
Add optional content layers panel.
Add outline panel.
Enable the Text Annotation Reply Tool. Note, in order to enable ability to edit/remove or add existing replies you need to configure SupportApi, otherwise the Reply Tool will be in read-only mode.
pass 'expanded' value if you wish the Reply tool to be expanded initially. Default value is collapsed.
Add Search panel.
Add a panel with a list of shared documents.
Add sticky note to the document. Requires SupportApi.
page relative point. Origin is top/left. Note, pageIndex must be specified.
Add Thumbnails panel
Call this method in order to apply changed options.
Call this method in order to apply changes in @see:toolbarLayout.
Suspends notifications until the next call to @see:endUpdate.
This method changes coordinate system origin for rectangle given by parameter bounds and returns converted rectangle value;
Page index (Zero based).
bounds array: [x1, y1, x2, y2]
Source coordinate system origin. Possible values are: 'TopLeft' or 'BottomLeft'.
Destination coordinate system origin. Possible values are: 'TopLeft' or 'BottomLeft'.
This method changes coordinate system origin for y coordinate given by parameter y and returns converted value.
Converts the origin of the Y coordinate to the bottom.
Converts the origin of the Y coordinate to the top.
Clone annotation or field given by parameter annotation. Requires SupportApi.
Annotation to clone.
Closes the side panel.
Optional. Panel handle or panel id to close.
Delete page. Requires SupportApi.
page index to delete.
Use this method to close and release resources occupied by the GcPdfViewer.
Downloads the PDF document loaded in the Viewer to the local disk.
the destination file name.
Resumes notifications suspended by calls to @see:beginUpdate.
Execute Copy action (Ctrl + C shortcut). Requires SupportApi.
data to copy.
Execute Cut action (Ctrl + X shortcut). Requires SupportApi.
data to cut.
Execute Delete action (DEL shortcut). Requires SupportApi.
data to delete.
Execute Paste action (Ctrl + V shortcut). Requires SupportApi.
insert position.
Find annotation(s) within opened document. Returns promise which will be resolved with search results.
Find query.
find parameters. By default annotation will be searched by id without page constraint.
Gets meta data information for the current document.
Gets security information for the current document.
Get the page rotation value.
Returns the page size. By default, return size without scale, pass true for the includeScale argument if you want to get the scaled value.
Page index (Zero based).
Optional. If true, the method will return scaled value.
Get page fields tabs order.
Returns the contents of the text selection.
Returns PDF page view port information.
Page index (Zero based).
Object containing following fields: { viewBox: // Original page bounds: [x1, y1, x2, y2]. // If you want to know original page's width/height, you can get it using viewBox values: // var pageWidth = viewBox[2] - viewBox[0]; // var pageHeight = viewBox[3] - viewBox[1]; width: // Current width of the page in user space (scale and rotation values are applied), height: // Current height of the page in user space (scale and rotation values are applied) scale: // Active scale value rotation: // Active rotation value }
Go to the first page.
Go to the last page.
Go to the next page.
Go to the page with the specific page number (numbering starts at 1).
Go to the previous page.
The method loads the page at the index specified by the pageIndex parameter, and scrolls the page into the view.
Destination page index.
The parameter is used for the @see:scrollPageIntoView method after the page is fully loaded.
Returns the boolean promise that resolves when the page is fully loaded (including text and annotation layers) and scrolled. A promise is resolved with false value when the page does not exist or an error occurs, otherwise the promise is resolved with true value.
Load an updated document list into document list panel.
Optional. Document list service URL.
Loads the updated list of shared documents into the shared documents panel.
Lock annotation for editing.
annotation id
Creates and opens a new blank document. Requires SupportApi.
Parameters object: fileName - name of the file for a new document, confirm - show confirmation dialog if there are changes in the document.
Adds a blank page to the document. Requires SupportApi.
parameters object: width - page width in points, height - page height in points, pageIndex - target page index.
Open PDF document.
URI to PDF document(string) or binary data(Uint8Array).
Show the file open dialog where the user can select the PDF file.
Opens the side panel.
Panel handle or panel id to open.
Open shared document.
Opens the browser's print document dialog box.
Redo document changes. Requires SupportApi.
Remove annotation from document. Requires SupportApi.
Repaint pages. This method also redraws the page annotations.
If specified, page indices to be redrawn, otherwise, this method redraws visible pages.
Downloads the modified PDF document to the local disk. Requires SupportApi.
destination file name.
Upload local changes to server. Requires SupportApi.
Scroll annotation into view.
Scroll page into view.
object. Scroll parameters: pageNumber - number. Page number. destArray - Array with destination information: destArray[0] // not used, can be null, pdf page reference (for internal use only). destArray[1] // contains destination view fit type name: { name: 'XYZ' } - Destination specified as top-left corner point and a zoom factor (the lower-left corner of the page is the origin of the coordinate system (0, 0)). { name: 'Fit' } - Fits the page into the window { name: 'FitH' } - Fits the widths of the page into the window { name: 'FitV' } - Fits the height of the page into a window. { name: 'FitR' } - Fits the rectangle specified by its top-left and bottom-right corner points into the window. { name: 'FitB' } - Fits the rectangle containing all visible elements on the page into the window. { name: 'FitBH' } - Fits the width of the bounding box into the window. { name: 'FitBV' } - Fits the height of the bounding box into the window. destArray[2] // x position offset destArray[3] // y position offset (note, the lower-left corner of the page is the origin of the coordinate system (0, 0)) destArray[4] // can be null, contains bounding box width when view name is FitR, contains scale when view name is XYZ, destArray[5] // can be null, contains bounding box height when view name is FitR
Select the annotation to edit. Requires SupportApi.
Page index (zero based) or annotation id.
Annotation id or annotation object itself.
Use the setAnnotationBounds method to set the position and / or size of the annotation.
annotation object or annotation id.
Destination bounds - x, y, width and height are optional.
Source coordinate system origin. Default is TopLeft
Select annotation after editing. Default is false.
Set the absolute page rotation in degrees. Valid values are 0, 90, 180, and 270 degrees. Requires SupportApi.
Set page size. Requires SupportApi.
Set page fields tabs order. Possible values are: R - Row order. C - Column order. S - Structure order (not supported by GcPdfViewer).
Set active viewer theme.
theme name, specified in themes option.
Displays 'Form filler' dialog.
Shows the message for the user.
Displays the 'Add Signature' dialog. Requires SupportApi.
Optional. These settings will take priority over signSettings option.
Executes "Submit A Form action" to send filled form data to a web server or email. Form data is submitted as HTML form using HTML submit method.
Converts point to page's viewport taking into account page scale.
Undo document changes. Requires SupportApi.
Unlock annotation for editing.
annotation id
Reset annotation selection. Requires SupportApi.
Update annotation. Requires SupportApi.
Promise, resolved by updated annotation object.
Update multiple annotations at the same time. Requires SupportApi.
Promise, resolved by updated annotation objects.
Update radio buttons group given by parameter fieldName with new field value.
Grouped radio buttons field name
New fieldValue
boolean. Set to true if you don't need to update page display. Default is false.
Promise resolved by boolean value, true - radio buttons updated, false - an error occurred.
Use this method to validate an active form and get the validation result.
Optional. The validator function which will be called for each field in the form. You can return a string value with message about validation error, this message will be shown in UI. Return true or null for success result.
Optional. Pass true if you don't want to display any messages to the user, but just want to get the final validation result.
Optional. Pass true to skip validation using field attributes such as required, min, max, minLength, maxLength, email and pattern, these attributes will be ignored.
Returns true if validation was successful, false, or a string with a validation error message when validation is failed.
GcDocs PDF Viewer control.