Class: eViewerApp
Constructor
constructor(userName)
Summary:
The username in the eViewer v7 is mandatory to provide. By default, it is set to ‘Administrator’.
Set User Name
setUserName(userName)
Summary:
User can manipulate the default username and set the name of the user as per the choice.
Load Viewer
loadViewer(containerID, scripts, styleSheets, fitStyle)
Summary:
Initialize the viewer GUI and load viewer inside a div.
Parameters:
- containerID:
- Type: String value
- Description: It will contain the div id.
- scripts:
- Type: String value
- Description: An array of string containing the URLs to viewer script files.
var scripts = [ './viewer/runtime.js', './viewer/polyfills.js', './viewer/scripts.js', './viewer/main.js', './js/events.js', ];
- styleSheets:
- Type: String value
- Description: An array of objects containing references to CSS files for viewer to load.
- href: href tag is mandatory for linking. The path can be an absolute path or a relative path.
- Corresponding attributes: Along with href, other corresponding attributes can be added, such as integrity and cross origin in the example given below.
var css = [ { href: './viewer/styles.css' }, { href: 'https://cdnjs.cloudflare.com/ajax/libs/fontawesome/5.15.1/css/all.min.css', integrity: 'sha512 +4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNy eRssA=', crossorigin: 'anonymous' }
- fitStyle [optional]:
- Type: String value
- Description: There will be two possible values:
- default: Height of the viewer is predefined.
- bestFit:: Height of the viewer will be defined according to the container’s (device) height.
Returns:
Load viewer API returns a promise object which is resolved on successfully loading of the viewer.
Set Document End Point Options
setDocumentEndPointOptions(options, eViewerUrl, savingEndPoint, userName, ocrEndPoint)
Summary:
This API will set the end point options of the document.
Parameters:
- options:
- Type: JSON object
- Description: An object that contains an attribute:
- type: GET
- headers: An object having key value pairs of header name and value.
Example of headers:
headers: {Authorization: 'BearereyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OD kwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJS MeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'}
- savePayLoadType: A new optional attribute can now be passed in the options object. There are two possible values of this attribute:
- “application/json”
- “multipart/form-data”
By default, if not provided, value is “application/json”.
Example of options parameter:
let savePlType = "application/json"; // or "multipart/form-data" let options = { type: "GET", headers: { Authorization: "Bearer " + this.state.token, Accept: "application/octet-stream.", }, savePayLoadType: savePlType };
- eViewerUrl:
- Type: String value
- Description: URL to the eViewer server app in the below format:
<Protocol>://<IPAddress>:<PortNumber>/<ApplicationName>/<api>/<version>
Example: http://192.168.10.100:8988/eViewerServerv0.0.18/api/v1
- savingEndPoint:
- Type: String value
- Description: The format of the saving end point URL:
<Protocol>://<IPAddress>:<PortNumber>/<ApplicationName>/<MehthodForSavingFileType>
Example: http://192.168.10.100:8988/eViewer/createTiffFile
- userName:
- Type: String value
- Description: Name of the document in the eViewer application.
- ocrEndPoint:
- Type: String value
- Description: URL to the OCR engine REST Endpoint:
<Protocol>://<IPAddress>:<PortNumber>/<ApplicationName>/<api>/<version>
Example: http://192.168.10.100:8988/OCRServiceAPI-0.0.2/api/v1
Returns:
A promise object, which is resolved when the execution finishes.
Register License
registerLicense(licenseKey)
Summary:
Validates and registers the license key for the eViewer v7.
Parameters:
- licenseKey:
- Type: String value
- Description: String based license key as provided by the sales team.
Returns:
A promise object, which is resolved once the license key is validated.
Scanning Document
setScannerPluginURL(scannerPluginUrl)
Summary:
Set the URL of the scanner plugin which the user will download.
Parameters:
- scannerPluginUrl:
- Type: String value
- Description: It will store the absolute HTTP URL to download the scanner plugin.
Returns:
A promise object, which is resolved when the execution finishes.
Note: It is required to download the scanner plugin for calling this API. It can be skipped if the scanner plugin is already running and installed.
Toggle thumbnail
toggleThumbnail()
Summary:
Toggles the thumbnail panel to switch the thumbnail location in the viewer, to either the left or the right side of the document viewing area.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Hide Annotations
hideAnnotations(hide)
Summary:
Hides all annotations.
Parameters:
- hide:
- Type: Boolean value
- Description: Set to ‘true’ to hide all annotations of the document.
Returns:
A promise object, which is resolved when the execution finishes.
Hide Thumbnail
hideThumbnails(hide)
Summary:
Show and hide the page or document thumbnails.
Parameters:
- hide:
- Type: Boolean value
- Description: It will tell the viewer when to hide the thumbnail.
Returns:
A promise object, which is resolved when the execution finishes.
Select Panning
selectPanning(pan)
Summary:
Enables/disables page panning.
Parameters:
- pan:
- Type: Boolean value
- Description: Set to ‘true’ to enable panning mode.
Returns:
A promise object, which is resolved when the execution finishes.
Add Buttons
addButtons(buttons)
Summary:
Add buttons to the document.
Parameters:
- buttons:
- Type: Array of objects
- Description: Store the value of each attribute of a button.
[ { id: "", name: "", alignment: "ribbonToolbar or leftToolbar or rightToolbar", iconUrl: "path to png icon from assets folder", parent: "View or Annotate or Insert or Redact", //Only to be specified if alignment is ribbonToolbar placementIndex: "Set the sequence in ascending order according to the respective placement index", } ]
Returns:
A promise object, which is resolved when the execution finishes.
Update Buttons
updateButtons(buttons)
Summary:
Update button needs to be called to up the state of an existing custom button.
Parameters:
- buttons:
- Type: Array of objects
- Description: Store the value of each attribute of a button.
[ { id: "", name: "", alignment: "ribbonToolbar or leftToolbar or rightToolbar", iconUrl: "path to png icon from assets folder", parent: "View or Annotate or Insert or Redact", //Only to be specified if alignment is ribbonToolbar placementIndex: "Set the sequence in ascending order according to the respective placement index", } ]
Returns:
A promise object, which is resolved when the execution finishes.
Remove Buttons
removeButtons(buttons)
Summary:
Removes the button objects as provided in the buttons array.
Parameters:
- buttons:
- Type: Array of objects
- Description: Store the value of each attribute of a button.
[ { id: "", name: "", alignment: "ribbonToolbar or leftToolbar or rightToolbar", iconUrl: "path to png icon from assets folder", parent: "View or Annotate or Insert or Redact", //Only to be specified if alignment is ribbonToolbar placementIndex: "Set the sequence in ascending order according to the respective placement index", } ]
Returns:
A promise object, which is resolved when the execution finishes.
Get Document Service
getDocumentService()
Summary:
This instantiates and returns an object to the document service class.
Parameters:
No parameters.
Returns:
An object to the respective service class.
Get Editing Service
getEditingService()
Summary:
This instantiates and returns an object to the editing service class.
Parameters:
No parameters.
Returns:
An object to the respective service class.
Get Viewer Preference Service
getViewerPreferenceService()
Summary:
This instantiates and returns an object to the viewer preference service class.
Parameters:
No parameters.
Returns:
An object to the respective service class.
Get Watermark Service
getWatermarkService()
Summary:
This instantiates and returns an object to the watermark service class.
Parameters:
No parameters.
Returns:
An object to the respective service class.
Get Annotation Service
getAnnotationService()
Summary:
This instantiates and returns an object to the annotation service class.
Parameters:
No parameters.
Returns:
An object to the respective service class.
Class: DocumentService
Insert Document
insertDocument(file, options)
Summary:
Inserts a document in the viewer.
Parameters:
- file:
- Type: JSON object
- Description: File object that carries file information
{ name: “sample.pdf”, type: “application/pdf”, size: 10000 }
- options [optional]:
- Type: JSON object
- Description: Stores the information of filtered pages.
pageFilters: [{ "pageNo": 1, "visible": true }]
Returns:
A document ID in the promise object. After the promise object is resolved, it will show the filtered pages of the document.
Load Document
loadDocument(docUrl, annotationUrl, clientDocID, filename, options)
Summary:
Loads the document in viewer.
Parameters:
- docUrl:
- Type: String value
- Description: URL of the document stream to be loaded. It can be absolute URL or URL to any controller method that returns document stream.
- annotationUrl:
- Type: String value
- Description: URL of the annotation stream to be loaded with the document. It can be absolute URL or URL to any controller method that returns document stream
- clientDocID [optional]:
- Type: String value
- Description: Provide the client’s custom document ID. Passing clientDocID is optional, but it needs to be unique, if passed.
- fileName [optional]:
- Type: String value
- Description: Contains the name of the file to be displayed if loading documents via URL and URL does not contain file name in its last segment.
If there is a file name in the URL and user also provides the name in this parameter, then this name overwrites the name mentioned in the URL.
Example of a URL not containing file name: http://myserver/getFile/somefileID
- options:
- Type: JSON object
- Description:It will hold the information about various attributes:
- IsEditMode [optional]: Stores the Boolean value to allow the annotation movement. By default, it sets to “true”.
- repoType [optional]: Stores the string value. By default, its value is “filesystem”.
- Password [optional]: Stores the string value to hold password. By default, it is an empty string.
- landingPage [optional]: Stores the Boolean value to allow the annotation movement. By default, its value is “1”.
- pageFilters [optional]: Stores the information of filtered pages including the page number and its visibility.
{ isEditMode: true, repoType: "filesystem", password: "", landingPage: 1, pageFilters: [{ "pageNo": 1, "visible": true }] }
Returns:
A promise object upon resolve, the viewerDocID created by viewer and the clientDocID that might be provided by the client, is passed to the observer.
{ viewerDocID: docId, clientDocID: uploadDetail. clientDocID "filesystem", }
After the promise object is resolved, it will show the filtered pages of the document.
New Document
newDocument(filetype)
Summary:
Creates a new blank viewer document tab to which pages can be added through copy or paste operation and then it can be either saved as PDF or TIFF format. The default format type of this new document is PDF.
Parameters:
- filetype:
- Type: String value
- Description: It contains a string value for the document file type. Valid values are:
- TIFF
Returns:
A promise object, which is resolved when the execution finishes, and the object of viewerDocID as an attribute, is passed.
returns "{ viewerDocID: currentDocId }"
Get All Open Documents
getOpenDocuments ()
Summary:
Provides a list of all open documents.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes, and the array of viewerDocID and clientDocID are passed as an argument.
returns array of "{ viewerDocID: doc.docId, clientDocID: doc.clientDocID }"
Get Active Document
getActiveDocument()
Summary:
The currently visible document in eViewer’s document viewing area.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes, and the object of viewerDocID is passed as an argument.
returns "{ viewerDocID: activeDocID, clientDocID: clntDocID }"
Get Current Page
getCurrentPage()
Summary:
It returns the page number currently active in the viewer.
Parameters:
No parameters.
Returns:
A promise object upon resolve, the page number active in the viewer is passed to the observer in an object.
returns "{ currentPage: pgNo }"
Close Document
closeDocument(docId)
Summary:
Closes the document rendered in the viewer.
Parameters:
- docId:
- Type: String value
- Description: ID of the document to close.
Returns:
A promise object, which is resolved when the execution finishes, and viewerDocID of the document is passed as an argument.
returns { viewerDocID: docID }
Close All Documents
closeAllDocuments(docIds)
Summary:
Close all documents rendered in the viewer.
Parameters:
- docIds:
- Type: String Array
- Description: This array contains the document IDs of all the documents to be closed.
Returns:
A promise object, which is resolved when the execution finishes, and the document IDs of all the documents is passed as an argument.
Save Document
saveDocument()
Summary:
Save the selected document to the provided saving endpoint with the setDocumentSavingEndPoint API.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Save All Documents
saveAllDocuments()
Summary:
Save all the documents to the provided saving endpoint using the setDocumentSavingEndPoint API.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Next Page Traversing
nextPage()
Summary:
Renders the page which is following the current page displayed.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Previous Page Traversing
prevPage()
Summary:
Renders the page which is previous the current page displayed.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
First Page Traversing
firstPage()
Summary:
Renders the first page of the document.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Last Page Traversing
lastPage()
Summary:
Renders the last page of the document.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Go to Page Traversing
gotoPage(pageNo)
Summary:
Navigates to the desired page of the document via the page number.
Parameters:
- pageNo:
- Type: Number value
- Description: Number type value from the user input.
Returns:
A promise object, which is resolved when the execution finishes.
Append Document
appendDocument(file, base64FileData)
Summary:
Append another document in the already displayed document.
Parameters:
- file:
- Type: JSON Object
- Description: File object that carries file information.
{ name: “sample.pdf”, type: “application/pdf”, size: 10000 }
- base64FileData:
- Type: Base 64 string value
- Description: Base64 string of the file content.
Returns:
A promise object, which is resolved when the execution finishes, and the page count is passed as an argument.
Get Page Count
getPageCount(docId)
Summary:
Gets the total number pages of a document.
Parameters:
- docId:
- Type: String value
- Description: The document ID of a document.
Returns:
A promise object, which is resolved when the execution finishes, and the total number of pages are passed as an argument.
Filter Pages
filterPages(docId, pageFilters)
Summary:
Filter the pages of the document. This API can be invoked anytime during the viewer session, however, only after the load document or the insert document promise object has been resolved.
Parameters:
- docId:
- Type: String
- Description: ID of the document.
- pageFilters:
- Type: Array of objects
- Description: Holds the information of filtered pages.
- pageNo:
- Type: Number
- Description: Stores the page number of the document.
- visible:
- Type: Boolean
- Description: Informs about the visibility of the page and if that page filtered or not.
pageFilters: [{ "pageNo": 1, "visible": true }]
Note: By default, the visible property of page is set as “true”. It means that the page value is visible until and unless any filter applied successfully.
Returns:
A promise object, which is resolved when the execution finishes, and the total number of pages are passed as an argument.
{ "success": true, }
Show Only Pages
showOnlyPages(docId, pages)
Summary:
Show specified pages of the document and hide all others. If no pages are specified, then all pages will be displayed.
Parameters:
- docId:
- Type: String
- Description: ID of the document.
- pages:
- Type: Array of Numbers
- Description: Pages numbers that need to be rendered.
- Example: [1,2,3]
Returns:
A promise object upon resolve, an object is received which indicates the success of applied filters.
{ "success": true, }
Hide Only Pages
hideOnlyPages(docId, pages)
Summary:
Hide specified pages of the document and show all others. If no pages are specified, then all pages will be displayed.
Parameters:
- docId:
- Type: String
- Description: ID of the document.
- pages:
- Type: Array of Numbers
- Description: Pages numbers that need to be hidden.
- Example: [1,2,3]
Returns:
A promise object upon resolve, an object is received which indicates the success of applied filters.
{ "success": true, }
Get Document Info
getDocumentInfo(docId)
Summary:
Get the document information.
Parameters:
- docId:
- Type: String
- Description: ID of the document.
Returns:
A promise object upon resolve, an object is received which indicates the success of applied filters.
{ "docId": "", "clientDocId": "", "docName": "", "size": 0, "pageCount": 0, "fileFormat": "PDF" }
File format can be: PDF, TIFF, PNG, JPG, BMP, GIF, TXT.
Get Active Document Info
getActiveDocumentInfo()
Summary:
Get the document information which is active or currently highlighted.
Parameters:
No parameters
Returns:
A promise object, upon being resolved, receives the highlighted document information.
{ "docId": "", "clientDocId": "", "docName": "", "size": 0, "pageCount": 0, "fileFormat": "PDF" }
File format can be: PDF, TIFF, PNG, JPG, BMP, GIF, TXT.
Get Page Info
getPageInfo(docId, pageRange)
Summary:
Get the page information.
Parameters:
- docId:
- Type: String
- Description: ID of the document.
- pageRange:
- Type: String
- Description: Can hold a single page (i.e.1), comma separated page numbers (i.e.1,2,6), hyphen separated page range (i.e.1-6) or all pages.
Returns:
A promise object, upon being resolved, receives an array of objects containing all the information regarding page.
[{ "pageNo": 1, "visible": true, "height": 500, "width": 500, "xDPI": 96, "yDPI": 96, "bitDepth": 24 }]
Values of height and width will be in value of pixels. Bit Depth can be: 1, 4, 8, 16, 24, 32.
Text Search
searchText(text)
Summary:
Search text in a document, and the results will be highlighted in the viewer.
Parameters:
- text:
- Type: String value
- Description: It holds the text that needs to be searched.
Returns:
A promise object, which is resolved when the execution finishes, and the total number of occurrences are passed as an argument.
Class: EditingService
Zoom In
zoomIn()
Summary:
Zoom In API enlarges an area of the document viewing area.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes, and the current zoom percentage is passed as an argument.
Zoom Out
zoomOut()
Summary:
Zoom Out API makes the page view of the document smaller.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes, and the current zoom percentage is passed as an argument.
Rotate Clockwise
rotateClockwise()
Summary:
Rotate the selected page in a clockwise motion.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes, and the new rotation angle is passed as an argument.
Fit to Width, Fit to Window, Fit to Height, Fit to Actual Size
zoomTo(preset)
Summary:
Change the size of the page view according to the following requests: “Fit to Width”, “Fit to Window”, “Fit to Height”, or “Actual Size”.
Parameters:
- preset:
- Type: String value
- Description: Valid inputs are:
- Fit to Width
- Fit to Window
- Fit to Height
- Fit to Actual Size
Returns:
A promise object, which is resolved when the execution finishes, and the current zoom percentage is passed as an argument.
Delete Page
deletePage()
Summary:
Deletes the selected page.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes, and the new page count is passed as an argument.
Copy Page
copyPage()
Summary:
Copies the selected page into viewer’s clipboard.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Cut Page
cutPage()
Summary:
Cuts the selected page into viewer’s clipboard.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Paste Page
pastePage()
Summary:
Adds the copied or cut page in the viewer’s clipboard to the document.
Parameters:
No parameters.
Returns:
A promise object, which is resolved when the execution finishes.
Get Current Scale
getCurrentScale(docId)
Summary:
Get the current scale information.
Parameters:
- docId:
- Type: String
- Description: ID of the document.
Returns:
A promise object, upon being resolved, receives the information about the document scale.
{ "docId": "", "scale": 1.0 "zoomPreset": "fitToWindow" }
The Scale describes the zoom value of the page. It can be calculated in percentage by multiplying by 100.
Example:
Value | Scale (%) |
0.5 | 50 |
1.0 | 100 |
1.5 | 150 |
Value of zoom pre-set can be “fitToWindow”, “fitToWidth” or “none”.
Get Current Rotation
getCurrentRotation(docId, pageNo)
Summary:
Get the current rotation information for a specific page of the document.
Parameters:
- docId:
- Type: String
- Description: ID of the document.
- pageNo:
- Type: Number
- Description: Stores page number of the document.
Returns:
A promise object, upon being resolved, receives the information about the document rotation.
{ "docId": "", "rotation": 90 }
Rotation defines the rotation angle of the page. The possible values for rotation angle are: 0, 90, 180, 270.
Export Document
exportDocument(exportData)
Summary:
Export document will export the selected document with input options. It will open the PDF file directly.
Parameters:
- exportData:
- Type: JSON Object
- Description: This parameter takes a JSON object which contains the information to export a document. Following attributes as described below:
- docName: The name of the document.
- pageOption: The possible values of page option will be:
- currentPage: Current page will be exported.
- currentDocument: Current document will be exported.
- pageRange: Selected pages will be exported from the particular document according to the page range. It will search for ‘startPageExport’ and ‘endPageExport’ values.
- allDocuments: All the documents will be merged and exported.
Note: If this ‘pageOption’ string is empty, then it will search for the page range through ‘startPageExport’ and ‘endPageExport’ values.
- formName: It stores fixed string value; i.e. ‘export’.
- selectedOption: The possible values are ‘PDF’ or ‘Tiff’.
- startPageExport: The start page for exporting document. It will always be lesser or equal to ‘endPageExport’ value.
- endPageExport: The end page for exporting document. It will always be greater or equal to ‘startPageExport’ value.
- withAnn: This reads a string value, instead of ‘boolean’, to whether add the annotations in the exported document or not. If the string value is ‘true’, annotations should be definitely included in exporting, otherwise the value will be ‘false’.
- asStream: In case, the value is ‘false’, file will be downloaded otherwise the stream will be returned.
The schema of JSON is as follows:
{ "docName":"test.pdf", "pageOption": "allDocuments", "formName": "export", "selectedOption": "pdf", "startPageExport": 1, "endPageExport": 3, "withAnn": false, "asStream": false, }
Returns:
A promise object, which is resolved when the execution finishes, and download the document to the browser.
Print Document
printDocument(printData)
Summary:
Print document will print the selected document with input options.
Parameters:
- printData:
- Type: JSON object
- Description: This parameter takes a JSON object which contains the information to print a document. Following attributes as described below:
- docName: The name of the document.
- pageOption: The possible values of page option will be:
- currentPage: Current page will be printed.
- currentDocument: Current document will be printed.
- pageRange: Selected pages will be printed from the particular document according to the page range. It will search for ‘startPagePrint’ and ‘endPagePrint’ values.
- allDocuments: All the documents will be merged and printed.
Note: If this ‘pageOption’ string is empty, then it will search for the page range through ‘startPagePrint’ and ‘endPagePrint’ values.
- formName: It stores fixed string value; i.e. ‘print’.
- selectedOption: The possible values are ‘PDF’ or ‘Tiff’.
- startPagePrint: The start page for printing document. It will always be lesser or equal to ‘endPagePrint’ value.
- endPagePrint: The end page for printing document. It will always be greater or equal to ‘startPagePrint’ value.
- withAnn: This reads a string value, instead of ‘boolean’, to whether add the annotations in the printed document or not. If the string value is ‘true’, annotations should be definitely included in printing, otherwise the value will be ‘false’.
The schema of JSON is as follows:
{ "docName":"test.pdf", "pageOption": "currentDocument", "formName": "print", "selectedOption": "pdf", "startPageExport": 5, "endPageExport": 7, "withAnn": "true", }
Returns:
A promise object, which is resolved when the execution finishes.
Class: ViewerPreferenceService
Set User Preferences
setUserPreferences(preferences, shortcutPreferences)
Summary:
Set user preferences in the viewer settings.
Parameters:
- preferences:
- Type: JSON object
- Description: This parameter contains a JSON input.
- shortcutPreferences:
- Description: A new parameter to pass the updated shortcut preference JSON is now available in setUserPreferences API.
- Description: A new parameter to pass the updated shortcut preference JSON is now available in setUserPreferences API.
Returns:
A promise object, which is resolved when the execution finishes.
User Preferences Input JSON format:
{ "userInfo": { "userId": "ibRGHYys", "username": "Administrator" }, "leftDocToolbar": { "hideThumbnails": true, "panning": true, "zoom": true, "rotate": true, "fitToWindow": true, "fitToWidth": true }, "rightViewerToolbar": { "uploadDocument": true, "viewCheckpoints": true, "insertDocument": true, "newDocument": true, "scanDocument": true, "closeAllFile": true, "closeFile": true, "saveDocument": true, "viewComments": true, "info": true, "settings": { "userPreferences": true, "exportDocument": true, "print": true } }, "rightDocToolbar": { "pageNavigation": true }, "ribbonToolbar": [{ "name": "View", "isViewTabVisible": true, "children": { "split": true, "undo": true, "actual": true, "thumbnailView": true, "sideBysideView": true, "textSearch": true, "selectText": true } }, { "name": "Insert", "isInsertTabVisible": true, "children": { "cutCopyPaste": true, "deletePage": true, "checkpoint": true, "appendDocument": true, "watermark": true } }, { "name": "Annotate", "isAnnotationTabVisible": true, "children": { "line": true, "arrow": true, "circle": true, "rectangle": true, "pen": true, "highlight": true, "textAnnotation": true, "stamp": true, "polyLine": true, "polygon": true, "stickynote": true, "button": true, "showHideAnn": true } }, { "name": "Redact", "isRedactTabVisible": true, "children": { "redactWord": true, "redaction": true, "searchRedact": true, "redactViewMode": true, "clearRedaction": true } } ], "general": { "view": "pageView", "zoomPreference": "actualControl", "newDocPre": "pdf", "switchThumb": "right", "isLogEnabled": false, "selectedOption": "info", "isOcrEnabled": false, "firstChunkSize": 1, "annComments": true, "showDocThumbBar: true", "autogrowDocTabWidth: false" } }
Let’s discuss the user preferences JSON input in more detail:
The eViewer v7 provides the access to the user to shuffle or hide the functionalities with their relevant icons. They can manage to rearrange or reorganize the icons as per their choice.
- Repositioning of Buttons:
User can change the positioning of buttons. They can shift a button and place them in any other toolbar.
- Reorganizing of Buttons:
User can reorganize the icons. They can modify the sequence of the buttons within the toolbar.
User needs to follow the pattern of the JSON input object, and provide the values accordingly.
NOTE:
- Upload document, Insert document and Scan document cannot be reshuffled because of the URL update. If user tries to rearrange any of them, then these features will be non-functional.
- All buttons can be hidden, except settings button. It will be visible with an empty frame if all the three attributes (i.e. userPreferences, exportDocument, print) are hidden.
- If the client desires to remove the whole settings panel, then he has to remove the settings attribute from the JSON input.
- All other icons can be repositioned and reorganized, except right document toolbar, that includes page navigation. It should be on a fixed position.
Description of JSON attributes:
Attribute | Type | Sub Attributes | Sub Attribute Type | Default Value | Description |
userInfo | Object | userId | String | “” | Id of the user. |
username | String | “” | Name of the user. | ||
leftDocToolbar | Object | hideThumbnails | Boolean | true | Add/Remove “hide thumbnails” button. |
panning | Boolean | true | Show/Hide the feature of panning. | ||
zoom | Boolean | true | Add/Remove both the features of zoom in and zoom out. | ||
rotate | Boolean | true | Show/Hide the rotation button. | ||
fitToWindow | Boolean | true | Show/Hide the fit to window view control. | ||
fitToWidth | Boolean | true | Show/Hide the fit to width view control. | ||
rightViewerToolbar | Object | uploadDocument | Boolean | true | Show/Hide the upload document feature. |
viewCheckpoints | Boolean | true | Add/Remove the feature for viewing checkpoints. | ||
insertDocument | Boolean | true | Show/Hide the insert document feature. | ||
newDocument | Boolean | true | Add/Remove the new document button. | ||
scanDocument | Boolean | true | Show/Hide the scan document feature. | ||
closeAllFile | Boolean | true | Show/Hide the close all file button from the tab. | ||
closeFile | Boolean | true | Show/Hide the close file button from the tab. | ||
saveDocument | Boolean | true | Add/Remove the save document button. | ||
viewComments | Boolean | true | Add/Remove the feature for viewing comments. | ||
info | Boolean | true | Enable/Disable the information button which shows the version number of the application. | ||
settings | Object | ||||
rightDocToolbar | Object | pageNavigation | Boolean | true | Add/Remove page navigation group of controls, which includes previous page, next page, go to page and total number of pages. |
ribbonToolbar | Array of Objects | name | String | View | Name of the view ribbon toolbar. |
isViewTabVisible | Boolean | true | Show/Hide the view tab with all controls. | ||
children | Object | ||||
name | String | Insert | Name of the insert toolbar. | ||
isInsertTabVisible | Boolean | true | Show/Hide the insert tab with all controls. | ||
children | Object | ||||
name | String | Annotate | Name of the annotation toolbar. | ||
isAnnotationTabVisible | Boolean | true | Show/Hide the annotation tab with all facilities. | ||
children | Object | ||||
name | String | Redact | Name of the redaction toolbar. | ||
isRedactTabVisible | true | Show/Hide the redact tab with all features. | |||
children | Object | general | Object | view | String | “pageView” | Defines the view of thumbnail window. The possible values are “pageView” and “docView”. |
zoomPreference | String | “actualControl” | Defines the default zoom value. The possible values are “actualControl”, “fitToWindowControl” and “fitToWidthControl”. | ||
newDocPre | String | “pdf” | The format type for saving new documents. | ||
switchThumb | String | “left” | Represents the direction of thumbnail tab. The possible values are “left” and “right”. | ||
isLogEnabled | Boolean | false | To enable or disable the browser console logs. | ||
selectedOption | String | “info” | The level of logging in browser console. The possible values are “info” and “debug”. | ||
isOcrEnabled | Boolean | false | Restricts the functionality of reading text in TIFF files. | ||
firstChunkSize | number | 1 (mb) | Controls the size of first chunk that is downloaded by the viewer. | ||
annComments | Boolean | true | Displays the annotation comments window on drawing any annotation. | ||
showDocThumbBar | Boolean | true | The document thumbnails will show up as usual. Set to ‘false’ to hide the document thumbnails. | ||
autogrowDocTabWidth | Boolean | false | Filename will cut off as usual, by default,. Set to ‘true’ to enable it to auto fit. |
Settings for Right Viewer Toolbar
Attribute | Type | Default Value | Description |
userPreferences | Boolean | true | Add/Remove the user preferences button. |
exportDocument | Boolean | true | Add/Remove the export document button. |
Boolean | true | Show/Hide the print document feature. |
Children for View Toolar
Attribute | Type | Default Value | Description |
split | Boolean | true | Restricts the use of split function in case of false value. |
undo | Boolean | true | Show/Hide the undo button. |
actual | Boolean | true | Show/Hide the actual window control. |
thumbnailView | Boolean | true | Add/Remove the thumbnail panel. |
sideBysideView | Boolean | true | Show/Hide the side by side view button from the tab. |
textSearch | Boolean | true | Show/Hide the text search feature. |
selectText | Boolean | true | Show/Hide the select text feature. |
Children for Insert Toolar
Attribute | Type | Default Value | Description |
cutCopyPaste | Boolean | true | Show/Hide all three buttons for cut, copy and paste respectively. |
deletePage | Boolean | true | Show/Hide the delete page functionality. |
checkpoint | Boolean | true | Add/Remove the checkpoint comments button. |
appendDocument | Boolean | true | Add/Remove the append document button. |
watermark | Boolean | true | Add/Remove the facility of drawing watermarks. |
Children for Annotate Toolar
Attribute | Type | Default Value | Description |
line | Boolean | true | Add/Remove the line annotation button. |
arrow | Boolean | true | Add/Remove the arrow annotation button. |
circle | Boolean | true | Add/Remove the circle annotation button. |
rectangle | Boolean | true | Add/Remove the rectangle annotation button. |
pen | Boolean | true | Add/Remove the pen annotation button. |
highlight | Boolean | true | Add/Remove the highlight annotation button. |
textAnnotation | Boolean | true | Add/Remove the text annotation button. |
stamp | Boolean | true | Add/Remove the stamp annotation button. |
polyline | Boolean | true | Add/Remove the polyline annotation button. |
polygon | Boolean | true | Add/Remove the polygon annotation button. |
stickynote | Boolean | true | Add/Remove the sticky notes button. |
button | Boolean | true | Add/Remove the button annotation button. |
showHideAnn | Boolean | true | Add/Remove the show hide annotation button. |
Children for Redact Toolar
Attribute | Type | Default Value | Description |
redactWord | Boolean | true | Add/Remove the redact word button. |
redaction | Boolean | true | Add/Remove the redaction button. |
searchRedact | Boolean | true | Show/Hide the search and redact button. |
redactViewMode | Boolean | true | Add/Remove the redact view mode functionality. |
clearRedaction | Boolean | true | Show/Hide the option of clear redaction. |
Get User Preferences
getUserPreferences(defaultPrefJSON, defaultShortcutPrefJSON, loadFromAssets)
Summary:
Get user preferences from the user.
Parameters:
- defaultPrefJSON:
- Type: JSON object
- Description: A JSON object to viewer preferences.
- defaultShortcutPrefJSON:
- Description: This is an optional parameter and it is functional. Shortcut is an array of object and every object has three attributes:
- Key: It provides shortcut patterns and assigned with respect to the command attribute. Combination of two keys will be separated by ‘+’ sign, so it is obligatory to add ‘+’ sign after every key within the combination.
- Command: It is fixed. It cannot be changed.
- Title: It can be according to the user’s choice.
Description of shortcut JSON in tabular format:
Key Command Title Alt+= zoomin Zoom In Alt+- zoomout Zoom Out Shift+S save Save Ctrl+Shift+X export Export Shift+P print Print Shift+HOME firstpage First Page Shift+END lastpage Last Page Alt+PAGEUP previouspage Previous Page Alt+PAGEDOWN nextpage Next Page Shift+R rotateclockwise Rotate Ctrl+Alt+B thumbnails Thumbnails Ctrl+Shift+Y redaction Redaction Alt+P search and redact Search And Redact Shift+Z redact view mode Redact View Mode Ctrl+Alt+L line Line Ctrl+Alt+R rectangle Rectangle Ctrl+Alt+C circle Circle Shift+Alt+O arrow Arrow Ctrl+Alt+P pen Pen Shift+Alt+H highlight Highlight Shift+Alt+K text Text Shift+Alt+S stamp Stamp Shift+Alt+M polyline Polyline Shift+Alt+N polygon Polygon Shift+Ctrl+Q checkpoint Checkpoint Ctrl+Alt+W watermark Watermark Ctrl+/ comments Comments Ctrl+M show-hide annotations Show-Hide Annotations DELETE delete annotations Delete Annotations Ctrl+1 actual size Actual Size Ctrl+2 fit to width Fit To Width Ctrl+3 fit to window Fit To Window Ctrl+X cut page Cut Page Ctrl+DELETE delete page Delete Page Ctrl+C copy page Copy Page Ctrl+V paste page Paste Page Ctrl+Shift+F search Search Shift+< previous search Previous Search Shift+> next search Next Search Alt+I version number Version Number Alt+H show keyboard hint Show Hotkeys Hint - Description: This is an optional parameter and it is functional. Shortcut is an array of object and every object has three attributes:
- loadFromAssets [optional]:
- Type: Boolean value
- Description: Set to true if user and annotation preferences are to be served explicitly from assets folder, or else set to false. If this parameter is not provided, then the default value false will be considered.
Returns:
A promise object, which is resolved when the execution finishes, and the preferences are passed as an argument.
Class: WatermarkService
Watermark
newWatermark(properties)
Summary:
Creates a new watermark.
Parameters:
- properties:
- Type: JSON object
- Description: This will have the following attributes as described below:
- stretch
- position
- opacity
- style
- name
- text
The schema of JSON is as follows:
{ "stretch": "100%", "position": "left or center or right", "opacity": "transparent or opaque", "style": "top or center or bottom or diagonal or revdiagonal", "name": "", "text": "sometext { EditBy | Date | Time | PageNumber | TotalPages | DocumentName }" }
Returns:
A promise object, which is resolved when the execution finishes, and the name of the watermark is passed as an argument.
Class: AnnotationService
Select Shape
selectShape(annType, options)
Summary:
Select shape for which type of annotation needs to be drawn.
Parameters:
- annType:
- Type: AnnotationType
- Description: Type of the annotation drawing. Possible values would be: “line”, “arrow”, “circle”, “rectangle”, “highlight”, “stamp”, “text”, “stickynote”, “checkpoint”
- options:
- Type: Object type
- Description: An object that includes two attributes: stamp type, i.e. either text stamp or image stamp, and info. We will get the information through Get Stamps API.
{ stampType: "imageStamp" or "textStamp", info: [{mimeType:"png", stampName:"Approved", stampURL:"stampurl"}] }
Returns:
A promise object, which is resolved when the execution finishes.
Get Stamps
getStamps(loadFromAssets)
Summary:
Get stamps API will provide the information about the image stamp to Select Shape API.
Parameters:
- loadFromAssets [optional]:
- Type: Boolean value
- Description: Set to true if predefined stamps are to be served explicitly from assets folder, or else set to false. If this parameter is not provided, then the default value false will be considered.
Returns:
A promise object, which is resolved when the execution finishes, and the array of objects, is passed as an argument to the Select Shape API.
return “[{mimetype: "", stampName:"", stampURL:""},{}]"
Draw Shapes
drawShapes(pageNo, position, options)
Summary:
Draws the annotation.
Parameters:
- pageNo:
- Type: Number
- Description: Page number starting from 1, of the page on which annotation needs to be drawn.
- position:
- Type: Object type
- Description: It stores the coordinates of the shape (annotation) to be drawn. Object that stores the position of the annotation ‘rectangle’:
- annCanvasStartX: Start X position of the annotation.
Note: The attribute name will be updated to “x” in the upcoming build. - annCanvasStartY: Start Y position of the annotation.
Note: The attribute name will be updated to “y” in the upcoming build. - annCanvasEndX: Width of the annotation.
Note: The attribute name will be updated to “width” in the upcoming build. - annCanvasEndY: Height of the annotation.
Note: The attribute name will be updated to “height” in the upcoming build. - x1: Start “x” position of stamp annotation.
Note: This parameter will be removed in future build and will be passed via “annCanvasStartX”. - y1: Start position of stamp annotation.
Note: This parameter will be removed in future build and will be passed via “annCanvasStartY”.
const position = { annCanvasStartX: 0, annCanvasEndX: 0, annCanvasStartY: 100, annCanvasEndY: 100, x1: , // For stamp only y1: , // For stamp only };
- annCanvasStartX: Start X position of the annotation.
- options:
- Type: JSON object
- Description: Not implemented yet, should be set as null, however, will contain the object that would store annotation properties
{ borderWidth: 0, borderColor: "RGB(0,0,0)", fillColor: "RGB(0,0,0)", text: "", opacity: 0.5, fontName: "Arial", fontSize: 10, image: "BASE64STRING or relative path to image" }
Returns:
A promise object, which is resolved when the execution finishes.
Edit Shape
editShape(docId, annId, pageNo, position, options)
Summary:
It will modify the annotations according to the new position and updated properties.
Parameters:
- docId:
- Type: String value
- Description: The document ID of a document.
Note: Kept for future use currently should be set to null.
- annId:
- Type: String value
- Description: The ID of the annotation to edit. This is the ID of the annotation that was created via callback “window._annCreated” event.
- pageNo:
- Type: String value
- Description: Index of the page starting from 1, of the page on which the annotation exists.
- position:
- Type: Object type
- Description: It stores the coordinates of the shape (annotation) to be drawn. Object that stores the position of the annotation ‘rectangle’:
- annCanvasStartX: Start X position of the annotation.
Note: The attribute name will be updated to “x” in the upcoming build. - annCanvasStartY: Start Y position of the annotation.
Note: The attribute name will be updated to “y” in the upcoming build. - annCanvasEndX: Width of the annotation.
Note: The attribute name will be updated to “width” in the upcoming build. - annCanvasEndY: Height of the annotation.
Note: The attribute name will be updated to “height” in the upcoming build. - x1: Start “x” position of stamp annotation.
Note: This parameter will be removed in future build and will be passed via “annCanvasStartX”. - y1: Start position of stamp annotation.
Note: This parameter will be removed in future build and will be passed via “annCanvasStartY”.
const position = { annCanvasStartX: 0, annCanvasEndX: 0, annCanvasStartY: 100, annCanvasEndY: 100, x1: , // For stamp only y1: , // For stamp only };
- annCanvasStartX: Start X position of the annotation.
- options:
- Type: JSON object
- Description: Not implemented yet, should be set as null, however, will contain the object that would store annotation properties
{ borderWidth: 0, borderColor: "RGB(0,0,0)", fillColor: "RGB(0,0,0)", text: "", opacity: 0.5, fontName: "Arial", fontSize: 10, image: "BASE64STRING or relative path to image" }
Returns:
A promise object, which is resolved when the execution finishes.
Delete Shape
deleteShape(pageNo, annId)
Summary:
It will delete the annotation with the respective annotation ID.
Parameters:
- pageNo:
- Type: String value
- Description: The page index on which the annotation exists.
- annId:
- Type: String value
- Description: The ID of the corresponding annotation.
Returns:
A promise object, which is resolved when the execution finishes.
Get All Annotations
getAllAnnotations(userName)
Summary:
It will return all the annotations on the document.
Parameters:
- userName [optional]:
- Type: String value
- Description: Show all the annotations for the specific username. In case, there is no username provided, then all the annotations will be returned.
Returns:
A promise object, which is resolved when the execution finishes, and the array of objects, is passed as an argument.
returns " [{annID: "", pgNo: ""},{annID: "", pgNo: ""}]"
Get Annotation Details
getAnnotationDetails(annId)
Summary:
It will provide the details of the respective annotation whose Id is entered as a parameter.
Parameters:
- annId:
- Type: String value
- Description: ID of the annotation.
Returns:
A promise object, which is resolved when the execution finishes, and the array of objects, is passed as an argument.
{ Id: "d7368cc8-bcba-4c05-926c-82f9b5eec8c2" annCreatorName: "a" annType: "Line" borderColor: "#FF0000" borderWidth: "5px" currentDate: "10/26/2021" currentTime: "7:17:30 PM" fillColor: "" fontSize: 0 fontStyle: "" opacity: "1.0" pageNo: 1 stampHeight: 0 stampImageUrl: "" stampWidth: 0 textColor: "" textValue: "" }
Get Filtered Annotations
getFilteredAnnotations(userName, annType, pageNo)
Summary:
It will return the information of annotations with respect to the provided details. In case, none of the parameter values are provided, then it will display the information for all the annotations.
Parameters:
- userName [optional]:
- Type: String value
- Description: Show all the annotations for the specific username. In case, there is no username provided, then all the annotations will be returned.
- annType [optional]:
- Type: String value
- Description: The type of annotation can be: Line, Rectangle, Circle, Arrow, Highlight, Text, Stamp, Stickynote or CheckPoint.
- PageNo [optional]:
- Type: Integer value
- Description: It stores the page number for which the annotation is being returned.
Returns:
A promise object, which is resolved when the execution finishes, and the array of objects, is passed as an argument.
[{ Id:"d7368cc8-bcba-4c05-926c-82f9b5eec8c2" annCreatorName: "a" annType: "Line" borderColor: "#FF0000" borderWidth: "5px" currentDate: "10/26/2021" currentTime: "7:17:30 PM" fillColor: "" fontSize: 0 fontStyle: "" opacity: "1.0" pageNo: 1 stampHeight: 0 stampImageUrl: "" stampWidth: 0 textColor: "" textValue: "" }]
Update Comment or Reply
updateCommentOrReply(annId, textUpdate, replyId)
Summary:
One can add new comment as well as update comment, but reply will only be edited according to the provided reply Id. New reply will not added through this API.
Parameters:
- annId:
- Type: String value
- Description: ID of the annotation.
- textUpdate:
- Type: String value
- Description: The text which needs to be edited.
- replyId:
- Type: String value
- Description: Id of the reply which is required to be updated.
Returns:
A promise object, which is resolved when the execution finishes.
Add Reply
addReply(annId, replyText)
Summary:
Add a reply to the annotation.
Parameters:
- annId:
- Type: String value
- Description: ID of the annotation.
- replyText:
- Type: String value
- Description: It stores the reply text.
Returns:
A promise object, which is resolved when the execution finishes.
Get Reply by User
getReplyByUser(annId)
Summary:
It takes annotation id as a parameter and checks if the current user has any reply or not. If there is no reply added by the current user, then he has to add a reply or it will return all the replies based on the user who has created the annotation.
Parameters:
- annId:
- Type: String value
- Description: ID of the annotation.
Returns:
A promise object, which is resolved when the execution finishes.
Get All Replies
getAllReplies(annId)
Summary:
Return all replies of an annotation.
Parameters:
- annId:
- Type: String value
- Description: ID of the annotation.
Returns:
A promise object, which is resolved when the execution finishes, and all replies are passed as an argument.
[{ "id":"a553c55d", "userName":"", "time":"10/26/2021 7:45:34 PM", "message":"reply" }, { "id":"80056aca", "userName":"", "time":"10/26/2021 7:46:14 PM", "message":"reply1" }]
Remove Reply
removeReply(replyId, annId)
Summary:
Removes the reply according to the respective reply id and annotation id. Current user can remove his reply, but not any other reply.
Parameters:
- replyId:
- Type: String value
- Description: Id of the reply which is required to be removed.
- annId:
- Type: String value
- Description: ID of the annotation.
Returns:
A promise object, which is resolved when the execution finishes.
Remove All Replies
removeAllReply(annId)
Summary:
Remove all replies for a particular annotation id. Current user can remove all his replies, but not any other reply.
Parameters:
- annId:
- Type: String value
- Description: ID of the annotation.
Returns:
A promise object, which is resolved when the execution finishes.
Event callback APIs for JavaScript integration
These event callback APIs for javascript integration are defined in ‘customevents.js’.
Document Load Complete
_docLoadComplete(docID) {
Summary:
This will be triggered after the loading of the document in the viewer.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
Document Save Complete
_docSaveComplete(docID, annotationData) {
Summary:
This will be triggered after the saving of the document.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- annotationData:
- Type: JSON object
- Description: It stores the JSON object as per the annotation schema definition.
Document Dropped
_docDropped(docID) {
Summary:
This will be triggered when the document is closed or deleted.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
Annotation Created
_annCreated(docID, pageNo, annID) {
Summary:
This will be triggered when the annotation is created.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number on which the annotation is drawn.
- annID:
- Type: String value
- Description: It stores the ID of the annotation.
Annotation Deleted
_annDeleted(docID, pageNo, annID) {
Summary:
This will be triggered when the annotation is deleted.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number on which the annotation is drawn.
- annID:
- Type: String value
- Description: It stores the ID of the annotation.
Annotation Property Updated
_annPropUpdated(docID, pageNo, annID, annProperty) {
Summary:
This will be triggered when the property of annotation gets updated.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number on which the annotation is drawn.
- annID:
- Type: String value
- Description: It stores the ID of the annotation.
- annProperty:
- Type: JSON object
- Description: It stores the JSON object as per the annotation schema definition.
{ "properties": { "COLOR":"255,0,0", "id":"4117c51c-edd8-4bc1-8ac6-261d7fbbc272", "PAGE":1, "BORDER": 5, "origAnnCordinate":1, "WIDTH":76, "X":510, "isTransparent": false, "Y":45, "TRANSPARENT":1, "LINEWIDTH":5, "HEIGHT":63, "PAGESIZE":"3417,4422" } }
Button Annotation Clicked
_buttonAnnClicked(docID, pageNo, annID, buttonText) {
Summary:
This will be triggered when the button annotation is clicked.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number on which the annotation is drawn.
- annID:
- Type: String value
- Description: It stores the ID of the annotation.
- buttonText:
- Type: String value.
- Description: It stores the text on the button.
Page Changed
_pageChanged(docID, pageNo) {
Summary:
This will be triggered when the page is modified.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number which is being changed.
Page Deleted
_pageDeleted(docID, pageNo) {
Summary:
This will be triggered when the page is deleted.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number which is deleted.
Page Cut
_pageCut(docID, pageNo) {
Summary:
This will be triggered when the page is cut.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number which is being cut.
Page Copied
_pageCopied(docID, pageNo) {
Summary:
This will be triggered when the page is copied.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number which is being copied on the clipboard.
Page Pasted
_pagePasted(docID, pageNo) {
Summary:
This will be triggered when the page is pasted.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- pageNo:
- Type: Integer value
- Description: It stores the page number which is being pasted from the clipboard.
Document Exported
_docExported(docID, selectionOption) {
Summary:
This will be triggered when the document is exported.
Parameters:
- docID:
- Type: String value
- Description: It stores the ID of the document.
- selectionOption:
- Type: String value
- Description: It contains the option selected by user. For example: all documents or customized or current document.
Text Selected
window._textSelected = function (response) {
Summary:
This API is invoked whenever a user selects text.
Parameters:
- response:
- Type: JSON Object.
- Description: It holds the below attributes:
{ "eventType": "TEXT_SELECTED", "coordinates": [ { "x1": 74.001, "y1": 191.70925, "x2": 525.1001692, "y2": 191.70925, "x3": 525.1001692, "y3": 178.24969, "x4": 74.001, "y4": 178.24969 }, { "x1": 54.015, "y1": 205.82624999999985, "x2": 130.12680450000002, "y2": 205.82624999999985, "x3": 192.68534499999998, "y3": 192.68534499999998, "x4": 54.015, "y4": 192.68534499999998, } ], "text": "First line \n Second line text.", "page": 2, "screenInfo": { "width": 1024, "height": 2048 }, "pageInfo": { "width": 1024, "height": 2048 } "pageRotation": 0, }