Page tree
Skip to end of metadata
Go to start of metadata

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)
DocViewer 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)


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



  • No labels