The TXDocumentViewer JavaScript object provides a public API to manipulate the document viewer via JavaScript functions in the browser.

Syntax

TXDocumentViewer

Methods

Method Description
addEventListener The addEventListener function registers event listener functions on the TXDocumentViewer object.
cancelSearch Cancels a currently active search process.
downloadDocument Downloads the current document as an Adobe PDF document.
export Exports all annotations as a JSON string.
find Finds a string in the currently loaded document.
getStampList Returns an array of available annotation stamp objects.
getValues Returns an array of all contained form fields with it's values completed by the user.
load Loads annotations from a JSON string.
loadDocument Loads a document from memory into the DocumentViewer.
lockZoom Locks the zoom to 100%.
nextSearchResult Moves to the next found search result and scrolls the DocumentViewer to that location.
printDocument Prints the content of the document using browser printing functionality.
scrollToPage Scrolls to the specific page in the currently loaded document.
selectSearchBox Selects the search input box in the DocumentViewer and sets the focus into it.
setStampList Loads a custom stamp list into the annotations.
toggleFullScreen Toggles between the browser full screen mode and the normal docked mode of the DocumentViewer.
toggleSelection Toggles the line text selection functionality of the DocumentViewer.
toggleSidebar Toggles the display of the document thumbnail sidebar of the DocumentViewer.
toggleToolbar Toggles the display of the undocked toolbar of the DocumentViewer.
validate Validates the form fields and returns true, in case all required fields are completed and false, in case fields are missing.

Properties

Property Description
showFormsBar Gets or sets whether to show an information bar that informs the user that a document contains fillable forms.
showSidebar Shows or hides the sidebar that contains the comments.
showToolbar Shows or hides the annotations toolbar.

Further Reading

Learn more about the Javascript: TXDocumentViewer Object in the Text Control Blog: