Class: eViewerApp

Load Viewer

loadViewer(containerID, scripts, styleSheets)

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',
      	     // './viewer/vendor.js', // only for non prod builds
      		'./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' }
        

Returns:

Load viewer API returns a promise object which is resolved on successfully loading of the viewer.

Set Document End Point Options

setDocumentEndPointOptions(options,saveUrl)

Summary:

This API will set the end point options of the document.

Parameters:

  • options:
    • Type: GET or POST
    • Description: An object that contains an attribute:
      • headers: An object having key value pairs of header name and value.

        Example of headers:

        headers: {Authorization: 
        'BearereyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OD
         kwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJS
         MeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'}
        

        Example of options parameter:

        let options = {headers:  {Authorization: 
        'BearereyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OD
        kwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJS
        MeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'}
        };
        
  • saveURL:
    • Type: String value
    • Description: The format of the saveURL:

      <Protocol>://<IPAddress>:<PortNumber>/<ApplicationName>/<MehthodForSavingFileType>

      Example: http://192.168.10.100:8988/eViewer/createTiffFile

Returns:

A promise object, which is resolved when the execution finishes.

Register License

registerLicense(licenceFileUrl, licenseServerUrl)

Summary: Closes the selected document.

Parameters:

  • licenceFileUrl:
    • Type: String value
    • Description: It will point towards a temporary license.
  • licenseServerUrl:
    • Type: String value
    • Description: It means that this is the license server that needs to register an instance and get the activation key.

Note: At least one of the parameters is required.

Returns:
A promise object, which is resolved when the execution finishes.

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
        }
      ]
      
      

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, fileUrl)

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
}
  • fileUrl:
    • Type: Base 64 String value
    • Description: Base64 string of the file content.

Returns:
A document ID in the promise object. 

Load Document

loadDocument(docUrl, annotationUrl, clientDocID, username, isEditMode, repoType, password, 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.
  • userName:
    • Type: String value
    • Description: Name of the document which need to be rendered in the eViewer application.
  • isEditMode:
    • Type: Boolean value
    • Description: True to allow annotation movement and false to prevent editing.
  • repoType:
    • Type: String value
    • Description: Set to “cm8” or “filesystem”.
  • password:
    • Type: String value
    • Description: Password to the cm8 username provided.
  • 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: String value
    • Description:Parameter to hold extra information.

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.

	returns "{ viewerDocID: docId, clientDocID: uploadDetail.clientDocID }"

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:
      • PDF
      • 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 }"

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(docId)

Summary:

Save the selected document to the provided saving endpoint with the setDocumentSavingEndPoint API.

Parameters:

  • docId:
    • Type: String value
    • Description: The document ID of a document

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, fileUrl)

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
      }
      
  • fileUrl:
    • 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.

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.

Export Document

exportDocument(options)

Summary:

Export document will export the selected document with input options.

Parameters:

  • options:
    • Type: JSON object
    • Description: This parameter takes a JSON object which contains the information to export a document. Following attributes as described below:
      • download
      • fileType
      • default
        • pages
      • custom
        • docId
        • pages

The schema of JSON is as follows:

{
   "download": true or false
   "fileType": "pdf or tiff",
    "default": {
      "pages": "all or current or all doc or range"
     },
    "custom": [{
      "docId": "",
      "pages": "all or current or all doc or range"
     },
     { ... }]
  }

Returns:
A promise object, which is resolved when the execution finishes, and a Base64 Stream of the document is passed as an argument. 

printDocument(options)

Summary:

Print document will print the selected document with input options.

Parameters:

  • options:
    • Type: JSON object
    • Description: This parameter takes a JSON object which contains the information to print a document. The schema of JSON is as follows:
      {
         "fileType": "pdf or tiff",
         "default": {
           "pages": "all or current or alldoc or range"
          },
         "custom": [{
           "docId": "",
           "pages": "all or current or alldoc or range"
          },
          { ... }]
      }
      

Returns:
A promise object, which is resolved when the execution finishes.

Class: ViewerPreferenceService

Get User Preferences

getUserPreferences(userName)

Summary:

Get user preferences from the user.

Parameters:

  • userName:
    • Type: String value
    • Description: Name of the user for which viewer’s settings needs to be modified.

Returns:
A promise object, which is resolved when the execution finishes, and the preferences are passed as an argument.

Set User Preferences

setUserPreferences(preferences)

Summary:

Set user preferences in the viewer settings.

Parameters:

  • preferences:
    • Type: JSON object
    • Description: This parameter contains a JSON input.
  • userName:
    • Type: String value
    • Description: Name of the user

Returns:
A promise object, which is resolved when the execution finishes.

Let’s discuss the user preferences in more detail:

  • JSON format:
    {
      "userId": "ibRGHYys",
      "username": "Administrator",
      "isAnnotationTabVisible": true,
      "isInsertTabVisible": true,
      "isRedactTabVisible": true,
      "isViewTabVisible": true,
      "saveDocument": true,
      "exportDocument": true,
      "print": true,
      "newDocument": true,
      "appendDocument": true,
      "pageNavigation": true,
      "hideThumbnails": true,
      "panning": true,
      "cutCopyPaste": true,
      "undo": true,
      "watermark": true,
      "deletePage": true,
      "split": true,
      "redaction": true,
      "searchRedact": true,
      "redactViewMode": true,
      "clearRedaction": true,
      "zoom": true,
      "fitToWindow": true,
      "fitToWidth": true,
      "actual": true,
      "thumbnailView": true,
      "rotate": true,
      "line": true,
      "arrow": true,
      "button": true,
      "rectangle": true,
      "circle": true,
      "highlight": true,
      "pen": true,
      "textAnnotation": true,
      "stamp": true,
      "polyLine": true,
      "polygon": true,
      "stickynote": true,
      "checkpoint": true,
      "view": "pageView",
      "zoomPreference":
      "actualControl",
      "textSearch": true,
      "showHideAnn": true,
      "closeAllFile": true,
      "closeFile": true,
      "newDocPre": "pdf",
      "switchThumb": "left",
      "isLogEnabled": false,
      "selectedOption": "info",
      "annComments": true,
      "isOcrEnabled":false,
      "firstChunkSize": 1
    }
    
  • Description of JSON attributes:
    Attribute Default Value Description
    userId “” Id of the user.
    Username “” Name of the user.
    isAnnotationTabVisible true Show/Hide the annotation tab with all facilities.
    isInsertTabVisible true Show/Hide the insert tab with all controls.
    isRedactTabVisible true Show/Hide the redact tab with all features.
    isViewTabVisible true Show/Hide the view tab with all controls.
    saveDocument true Add/Remove the save document button.
    exportDocument true Add/Remove the export document button.
    Print true Show/Hide the print document feature.
    newDocument true Add/Remove the new document button.
    appendDocument true Add/Remove the append document button.
    pageNavigation true Add/Remove page navigation group of controls, which includes previous page, next page, go to page and total number of pages.
    hideThumbnails true Add/Remove “hide thumbnails” button.
    Panning true Show/Hide the feature of panning.
    cutCopyPaste true Show/Hide all three buttons for cut, copy and paste respectively.
    Undo true Show/Hide the undo button.
    Watermark true Add/Remove the facility of drawing watermarks.
    deletePage true Show/Hide the delete page functionality.
    Split true Restricts the use of split function in case of false value.
    Redaction true Add/Remove the redaction button.
    searchRedact true Show/Hide the search and redact button.
    reactViewMode true Add/Remove the redact view mode functionality.
    clearRedaction true Show/Hide the option of clear redaction.
    Zoom true Add/Remove both the features of zoom in and zoom out.
    fitToWindow true Show/Hide the fit to window view control.
    fitToWidth true Show/Hide the fit to width view control.
    Actual true Show/Hide the actual window control.
    thumbnailView true Add/Remove the thumbnail panel.
    Rotate true Show/Hide the rotation button.
    Line true Add/Remove the line annotation button.
    Arrow true Add/Remove the arrow annotation button.
    Button true Add/Remove the button annotation button.
    Rectangle true Add/Remove the rectangle annotation button.
    Circle true Add/Remove the circle annotation button.
    Highlight true Add/Remove the highlight annotation button.
    Pen true Add/Remove the pen annotation button.
    textAnnotation true Add/Remove the text annotation button.
    Stamp true Add/Remove the stamp annotation button.
    Polyline true Add/Remove the polyline annotation button.
    Polygon true Add/Remove the polygon annotation button.
    Stickynote true Add/Remove the sticky notes button.
    Checkpoint true Add/Remove the checkpoint comments button.
    View “pageView” Defines the view of thumbnail window. The possible values are “pageView” and “docView”.
    zoomPreference “actualControl” Defines the default zoom value. The possible values are “actualControl”, “fitToWindowControl” and “fitToWidthControl”.
    textSearch true Show/Hide the text search feature.
    showHideAnn true Add/Remove the show hide annotation button.
    closeAllFile true Show/Hide the close all file button from the tab.
    closeFile true Show/Hide the close file button from the tab.
    newDocPre “pdf” The format type for saving new documents.
    switchThumb “left” Represents the direction of thumbnail tab. The possible values are “left” and “right”.
    isLogEnabled false To enable or disable the browser console logs.
    selectedOption “info” The level of logging in browser console. The possible values are “info” and “debug”.
    annComments true Displays the annotation comments window on drawing any annotation.
    isOcrEnabled false Restricts the functionality of reading text in TIFF files.
    firstChunkSize 1 (mb) Controls the size of first chunk that is downloaded by the viewer.

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 an attribute ‘isTextStamp’ of type string. Options is only required to be provided while creating text stamp. Support for drawing image stamps via API will be available shortly.
    • {
       isTextStamp : 'true',
      }
      

Returns:
A promise object, which is resolved when the execution finishes.

Draw Shape

drawShape(docId, pageNo, position, options)

Summary:

Draws the annotation.

Parameters:

  • docId:
    • Type: String value
    • Description: The document ID of a document. Value is null.
      Note: Kept for future use currently should be set to null.
  • 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
          };
      
      
  • 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
          };
      
      
  • 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.

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.

Load Viewer

loadViewer (webAppUrl: string, serverAppUrl: string, iframeId: string, iframeHeight: number, viewerDiv: any, customUI:any)

Summary:

Load viewer is an initial step for accessing eViewer and to view documents with it. The user will provide the desired URL within the given fields, and the viewer will create the iFrame dynamically with the desired content. It contains promise object of type JSON.
The set viewer URL API will be called to create the viewer URL internally using this command.

integrationService.setViewerURL(viewerUrl, docSaveUrl, docLoadUrl)

Parameters:

  • webAppUrl: URL of eViewer’s main web components. The format of the URL will be:

    <Protocol>://<IPAddress>:<PortNumber>/<ApplicationName><VersionNumber></VersionNumber>

    Example: http://192.168.10.100:8988/eViewer7.0.37

  • serverAppUrl: URL to eViewer’s server component. The format of the URL will be:

    <Protocol>://<IPAddress>:<PortNumber>/<ApplicationName><VersionNumber>

    Example: http://192.168.10.100:8988/eViewerServer-0.0.12

  • iframeId: Client will set the ID of the viewer frame.
  • iframeHeight: Client will set the height of the viewer frame.
  • viewerDiv: The outer div that will contain the viewer.
  • customUI [optional]: This parameter takes a JSON input in minified format.

    Example: [{“name”:”Custom”,”icon”:”assets/images/mst/home.svg”,”ctrls”:[{“title”:”My Button”,”icon”:”assets/images/mst/zoom-in.png”,”id”:”customButton_1″,”extralink”:false,”parent”:”Custom”,”type”:”link”,”class”:”enable-icons”}]}]

The schema of JSON is as follows:

[{
  "name":"NameOfTab",
  "icon":"image to be displayed present in
           assets folder",
  "ctrls":[
{
	"title":"Button Title",
  "icon":"icon from assests folder",
  "id":"customButton_<somename>",
  "extralink":false,
  "parent":"Name of Tab",
  "type":"link",
  "class":"enable-icons"
}
]
}]

Returns:

Load viewer API returns the message for successfully loading of the viewer stored in the promise object.

Set Viewer URL Document

setViewerURL(viewerUrl: string, docSaveUrl: string, docLoadUrl: string)

Summary:

Sets viewer URL, the internal step for viewing the document in eViewer. The main viewer will render in the iFrame, which is already created with the load viewer API and save all the desired locations.
Parameters:

  • viewerUrl: URL for eViewer. The format of the URL will be:

    <Protocol>://<IPAddress>:<PortNumber>/<ApplicationName><VersionNumber>

    Example: http://192.168.10.100:8988/eViewerServer-0.0.12

  • docSaveUrl: The format of the saving end point URL will be:

    <Protocol>://<IPAddress>:<PortNumber>/<ApplicationName>/<MehthodForSavingFileType>

    Example: http://192.168.10.100:8988/eViewer/createTiffFile

  • docLoadUrl: The format of the docLoadUrl will be:

    <Protocol>://<IPAddress>:<PortNumber>/<ServerApplicationName>/<FileUploadControllerName>

    Example: http://192.168.10.100:8988/applicationServer/getFileDetails

Register License

registerLicense(licenceFileUrl: string, licenseServerUrl: string)

Summary:

Close the selected document.

Parameters:

  • licenceFileUrl: It will point towards a temporary license.
  • licenseServerUrl: It means that this is the license server that needs to register an instance and get the activation key.

    Note: At least one of the parameters need to be required.

Returns:
A promise object, which is resolved when the execution finishes.

Set Document Loading End Point

setDocumentLoadingEndPoint(serverEndPoint: string, requestData: any, options: any)

Summary:

This API will set the loading end point of the document.
Parameters:

  • serverEndPoint: The format of the server end point will be:

    <Protocol>://<IPAddress>:<PortNumber>/<ServerApplicationName>/<FileUploadControllerName>

  • requestData: A JSON object with headers as key value pairs and data to be posted if any.
    {
      "reqHeaders": [],
      "body": "BASE64 Encoded Data"
    }
    
  • options: It will contain property to set if the response is Base64 or binary.
    {	
      "bodyContentBASE64": true,
      "responseContentBASE64": true
    }
    

Returns:
A promise object which is resolved when the execution finishes.

Insert Document

insertDocument(file:any, fileUrl:any)

Summary:

Inserts a document in the viewer.

Parameters:

  • file: File object that carries file information
    {
    	name: “sample.pdf”,
    	type: “application/pdf”,
    	size: 10000
    }
    
  • fileUrl: BASE64 string of the file content.

Returns:
A document ID in the promise object. 

Load Document

loadDocument(uploadDetail: any)

Summary:

Loads the document in viewer

Parameters:

  • uploadDetail: It carries file the document details.
    {
      name: “sample.pdf”,
      "userName": "abc",
      "password":"h",
      "viewerUrl":
      "http://192.168.10.100:9090/eViewerServer-0.0.16/api/v1",
      "repositoryType":"filesystem",
      "annotationUrl":
      "http://192.168.10.100:9090/eViewerServer-0.0.13/temp/1.json",
      "docDisplayName":"demo",
      "docDisplayName":
      "http://192.168.10.100:9090/eViewerServer-0.0.16/temp/pages.tif"
     }
    

Returns:
A promise object upon resolve, the document ID is passed to the observer.

Scanning Document

setScannerPluginURL(scannerPluginUrl: string)

Summary:

Closes the selected document.

Parameters:

  • scannerPluginUrl: It will hold the scanner details.

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.

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 document ID is passed as an argument.

Get All Open Documents

getOpenDocuments ()

Summary:

Provides a list of all open documents.

Parameters:
No parameters.

Returns:
A promise will be returned upon resolve, a JSON object with information (i.e., document ID and name) of all documents that have been rendered or are currently rendering will be passed.

Go To Document

gotoDocument(docId:string)

Summary:

Sets the focus to a selected document in the viewer.

Parameters:

  • docId: The unique document ID of the document to be viewed.

Returns:
A promise object will be resolved when the API finishes execution.

Toggle thumbnail

toggleThumbnail()

Summary:

Toggles the thumbnail panel to switch the thumbnail location in the viewer, either to the left or to the right side of the document viewing area.

Parameters:
No parameters.

Returns:
A promise object, which is resolved when the execution finishes.

Hide Thumbnail

hideThumbnails(hide: boolean)

Summary:

Show/hide the page or document thumbnails.

Parameters:

  • hide: contains a Boolean value.

Returns:
A promise object, which is resolved when the execution finishes.

Select Panning

selectPanning(pan: boolean)

Summary:

Enables/disables page panning.

Parameters:

  • pan: Set to “true” to enable panning mode.

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.

Previous Page Traversing

prevPage()

Summary:

Renders the page which is previous the current selected page.

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 to the selected page.

Parameters:
No parameters.

Returns:
A promise object, which is resolved when the execution finishes.

Go to Page Traversing

gotoPage(pageNo: number),

Summary:

Navigates to the desired page number of the document.

Parameters:

  • pageNo: Number type value from the user input.

Returns:
A promise object, which is resolved when the execution finishes.

Get Page Count

getPageCount(docId: string)

Summary:

Gets the total number pages of a document.

Parameters:

  • docId: 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.

Fit to Width, Fit to Window, Fit to Height, Fit to Actual Size

zoomTo(preset: string)

Summary:

Change the size of the page view according to the following requests: ‘Fit to Width’, ‘Fit to Window’, ‘Fit to Height’ or ‘Fit to Actual Size’.

Parameters:

  • preset: String value from the user input. 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.

Zoom In

zoomIn()

Summary:

Zoom In API enlarges an area of the page view.

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 much 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.

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 to the document from the viewer’s clipboard.

Parameters:
No parameters.

Returns:
A promise object, which is resolved when the execution finishes.

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.

searchText(text:string)

Summary:

Search text in a document. The results will be highlighted in the viewer.

Parameters:

  • text: 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.

Watermark

newWatermark(properties: any)

Summary:

Creates a new watermark.

Parameters:

  • properties: This parameter takes a JSON input in minified format. 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.

Select Shape

selectShape(annType: AnnotationType)

Summary:

Select shape for which type of annotation needs to be drawn.

Parameters:

  • annType: Type of the annotation drawing.

Returns:
A promise object, which is resolved when the execution finishes.

Draw Shape

drawShape(docId: string, pageNo: number, position: any, options: any)

Summary:

Draw the annotation.

Parameters:

  • docId: The document ID of a document.
  • pageNo: Page number on which annotation has been drawn.
  • position: It stores the coordinates of the shape (annotation) to be drawn.
    {
    x: 0,
    y, 0,
    width: 0,
    height: 0
    }
    

  • options: It stores additional information if required for any specific annotation.
    {
      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(annId: string, position: any, options: any)

Summary:

Adds a copied or cut page to the document from the viewer’s clipboard.

Parameters:

  • annId: The ID of the annotation.
  • position: It stores the coordinates of the shape (annotation) to be drawn.
    {
    x: 0,
    y, 0,
    width: 0,
    height: 0
    }
    
  • options: It stores additional information if required for any specific annotation.
    {
      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(annId: string)

Summary:

Delete the selected page.

Parameters:

  • annId: The ID of the annotation.

Returns:
A promise object, which is resolved when the execution finishes.

Add Reply

addReply(checkpointId: string, replyText: string)

Summary:

Add a reply to the checkpoint.

Parameters:

  • checkpointId: The ID of the checkpoint.
  • replyText: It stores the text reply.

Returns:
A promise object, which is resolved when the execution finishes.

Get All Replies

getAllReplies(checkpointId: string)

Summary:

Render all replies of a checkpoint.

Parameters:

  • checkpointId: The ID of the checkpoint.

Returns:
A promise object, which is resolved when the execution finishes, and all replies are passed as an argument.

Hide Annotations

hideAnnotations(hide: boolean)

Summary:

Hide all the annotations.

Parameters:

  • hide: Set to “true” to hide all annotations of the document.

Returns:
A promise object, which is resolved when the execution finishes.

New Document

newDocument(filetype: string)

Summary:

Open a new document in eViewer that may be in PDF or TIFF formats.

Parameters:

  • filetype: It contains a string value for the document file type. Valid values are:
  • PDF
  • TIFF

Returns:
A promise object, which is resolved when the execution finishes, and the ID of the document is passed as an argument.

Append Document

appendDocument(file: any, fileUrl: any)

Summary:

Append another document in the already selected document.

Parameters:

  • file: File object that carries file information.
    {
    	name: “sample.pdf”,
    	type: “application/pdf”,
    	size: 10000
    }
    
  • fileUrl: 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 User Preferences

getUserPreferences(userName: string)

Summary:

Get user preferences from the user.

Parameters:

  • userName: Name of the user for which viewer’s settings needs to be modified.

Returns:
A promise object, which is resolved when the execution finishes, and the preferences are passed as an argument.

Set User Preferences

setUserPreferences(preferences: any)

Summary:

Set user preferences in the viewer settings.

Parameters:

  • preferences: This parameter contains a JSON input.
    {
        "userId": "ibRGHYys",
        "username": "Administrator",
        "userType": 0,
        "displayType": "Admin",
        "createDate": 1582628896703,
        "imageControl": true,
        "annotationControl": true,
        "viewControl": true,
        "staticControl": true,
        "insertControl": true,
        "saveDocument": true,
        "saveAsDocument": true,
        "exportDocument": true,
        "emailDocument": true,
        "print": true,
        "reportBug": true,
        "metaData": true,
        "pageNavigation": true,
        "textToSpeech": true,
        "filter": true,
        "handScroll": true,
        "hideThumbnails": true,
        "panning": true,
        "imageOperation": true,
        "cutCopyPaste": true,
        "undo": true,
        "watermark": true,
        "deletePage": true,
        "split": true,
        "redaction": true,
        "zoom": true,
        "fitToWindow": true,
        "fitToHeight": true,
        "fitToWidth": true,
        "actual": true,
        "thumbnailView": true,
        "horizontalView": true,
        "verticalView": true,
        "rotate": true,
        "line": true,
        "arrow": true,
        "rectangle": true,
        "circle": true,
        "highlight": true,
        "pen": true,
        "textAnnotation": true,
        "stamp": true,
        "polyLine": true,
        "polygon": true,
        "stickynote": true,
        "checkpoint": true,
        "view":"pageView",
        "zoomPreference":"actualControl",
        "textSearch":true,
        "textSelect":true,
        "switchthumbnail":true,
        "showHideAnn":true,
        "closeAllFile":true,
        "closeFile":true
    }
    

Returns:
A promise object, which is resolved when the execution finishes.

printDocument(options: any)

Summary:

Print document will print the selected document with input options.

Parameters:

  • options: This parameter takes a JSON input in minified format. The schema of JSON is as follows:
    {
       "fileType": "pdf or tiff",
       "default": {
         "pages": "all or current or alldoc or range"
        },
       "custom": [{
         "docId": "",
         "pages": "all or current or alldoc or range"
        },
        { ... }]
    }
    

Returns:
A promise object, which is resolved when the execution finishes.

Export Document

exportDocument(options: any)

Summary:

Export document will export the selected document with input options.

Parameters:

  • options: This parameter takes a JSON input in minified format. The schema of JSON is as follows:
{
  "download": true or false
  "fileType": "pdf or tiff",
  "default": {
    "pages": "all or current or alldoc or range"
   },
  "custom": [{
    "docId": "",
    "pages": "all or current or alldoc or range"
   },
   { ... }]
  }

Returns:
A promise object, which is resolved when the execution finishes, and a Base64 Stream of the document is passed as an argument.

Save Document

saveDocument(docId: string)

Summary:

Save the selected document to the provided saving endpoint with the setDocumentSavingEndPoint API.

Parameters:

  • docId: The document ID of a document.

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.

Set Document Saving End Point

setDocumentSavingEndPoint(savingEndPoint: string, requestData: any, options: any)

Summary:

This API will save the document.

Parameters:

  • savingEndPoint: The format of the saving end point URL:

    <Protocol>://<IPAddress>:<PortNumber>/<ApplicationName>/<MehthodForSavingFileType>

    Example: http://192.168.10.100:8988/eViewer/createTiffFile

  • requestHeaders: A JSON object with headers as key value pairs and data to be posted if any.
  • options: It will contain property to set if the response is Base64 or binary.

Returns:
A promise object, which is resolved when the execution finishes. 

Close Document

closeDocument(docId: string)

Summary:

Close a document in the viewer.

Parameters:

  • docId: ID of the document to close.

Returns:
A promise object, which is resolved when the execution finishes, and ID of the document is passed as an argument.

Close All Documents

closeAllDocuments(docIds: string[])

Summary:

Close all document will close all rendered documents in the viewer.

Parameters:

  • docIds: 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.