Is it possible to trigger print event for DocumentUltimate DocumentViewer?
Question asked by Andrew Karasev - 5/12/2020 at 4:21 AM
I need to trigger print event for DocumentUltimate DocumentViewer with the button outside the viewer. Is it possible to do it using javascript?

2 Replies

Reply to Thread
Cem Alacayir Replied
Employee Post Marked As Answer
You can use this:

Where documentViewer is the ID of the component (this is default ID if not specified).

If you want to skip print dialog and print specific pages directly:

//Pass page numbers (eg. "1-5, 8, 11-13") to print
documentViewer.iframe.contentWindow.readerControl.doPrint("1"); //prints only first page

documentViewer.iframe.contentWindow.readerControl.doPrint(""); //print all pages

//You can also pass page orientation as second parameter 
//(Auto: 0, Portrait: 1, Landscape: 2)
documentViewer.iframe.contentWindow.readerControl.doPrint("1", 2); //prints only first page with landscape orientation
Andrew Karasev Replied
Thank you! That works fine.

Reply to Thread