GcDocs PDF Viewer constructor.
root container element or selector pattern used to select the root container element.
Viewer options. @see ViewerOptions for further information.
Gets all document annotations.
Ask the user if he want to leave the page when document is modified.
Ask the user if he want to leave the page when document is modified.
Indicates whether opened document can be edited using SupportApi.
Gets/sets the current user name. The property is used by Annotation Editor as default value for 'author' field.
Gets/sets the current user name. The property is used by Annotation Editor as default value for 'author' field.
Gets or sets more precise Edit mode for Annotations or Form editor.
Gets or sets more precise Edit mode for Annotations or Form editor.
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.
Returns true if the document has been modified by the user.
Indicates if buffer contains any data.
Indicates whether document is loaded into view.
Gets a value indicating whether the pdf viewer can redo document changes.
Indicates whether the Reply Tool has been added.
Gets a value indicating whether the pdf viewer can undo document changes.
Gets if annotations layer is hidden.
Sets if annotations layer should be hidden.
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).
Occurs when a document is opened.
Occurs immediately before the document opens.
The event indicating error.
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.
Gets/sets rotation in degrees.
Gets/sets rotation in degrees.
Gets the SupportApi client.
Defines toolbar layout for different viewer modes: viewer, annotationEditor, formEditor.
Defines toolbar layout for different viewer modes: viewer, annotationEditor, formEditor.
Gets total undo levels count.
Gets current undo level index.
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.
Add annotation editor panel.
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"]
Add form editor 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 sticky note to the document.
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'.
Clone annotation or field given by parameter annotation.
Annotation to clone.
Delete page.
page index to delete.
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).
data to copy.
Execute Cut action (Ctrl + X shortcut).
data to cut.
Execute Delete action (DEL shortcut).
data to delete.
Execute Paste action (Ctrl + V shortcut).
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.
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.
Creates and opens a new blank document.
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.
parameters object: width - page width in points, height - page height in points, pageIndex - 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 browser's print document dialog box.
Redo document changes.
Remove annotation from document.
Repaint visible pages.
Downloads the modified PDF document to the local disk.
destination file name.
Upload local changes to server.
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.
Page index (zero based) or annotation id.
Annotation id or annotation object itself.
Set active viewer theme.
theme name, specified in themes option.
Submit the form to the server.
Converts point to page's viewport taking into account page scale.
Undo document changes.
Reset annotation selection.
Update annotation.
Promise, resolved by updated annotation object.
Update multiple annotations at the same time.
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.
GcDocs PDF Viewer control.