Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The DocViewer is a panel-level control which allows displaying a pdf document inline.

For full description of attributes and events of this object please access the Client-Logic API

 The Docviewer control is embeded in an iframe representing the index.html file of the Snowbound document viewer library.

On the DocViewer Control you can use the method dispatchMethodCall to call methods from Snowbound document.

  • dispatchMethodCall(methodName: string, params: any = null)


Code Block
titleDocViewer call method from SnowBound document viewer
const docViewer = eventSource.window.getDocViewer('MyDocViewer');

docViewer.dispatchMethodCall('getPageCount')
 .then((numPages) => {
 console.log(numPages);
});


The method setCallback can be used to set an event callback for events inside the SnowBound control.

  • setCallback(eventName: DocViewerEventType, callback: (params: any)


Code Block
// if the docviewer is not loaded
DocViewer.setCallback('onDocumentLoad', () => {
	DocViewer.controller.hideToolbarButton('SaveDocument');
	DocViewer.controller.hideSideToolbar();
	return null;
});