Is it possible to trigger print event for DocumentUltimate DocumentViewer?
Question asked by Andrew Karasev - 5/12/2020 at 4:21 AM
Answered
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
1
Cem Alacayir Replied
Employee Post Marked As Answer
You can use this:

documentViewer.iframe.contentWindow.readerControl.print();
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
0
Andrew Karasev Replied
Thank you! That works fine.

Reply to Thread