PDF SDK / Web Viewer - printing from iOS

55 views
Skip to first unread message

Support

unread,
Apr 8, 2013, 1:41:37 PM4/8/13
to pdfnet-w...@googlegroups.com
Q:
 
I tried the online demos of the WebViewer and they didn't print right. Does the PDFTron WebViewer SDK print correctly from iOS? Is there a print button that can be put on the html page that will print the pdf?

-------

A:
 

The WebViewer supports native printing in Silverlight and Flash version of the WebViewer client. 'HTML5 WebViewer' does not include built-in print option because current browsers do not provide proper print support. We are looking forward to proper print support in modern browsers, but in the meantime downloading PDF, XPS, or printing via images seems to be a compromise for most users.

 

As mentioned above most web browsers are not very good at printing. For example, they have the annoying habit of including URLs and dates across the footer of a page. The pages are frequently not paginated well, fonts/sizes are wrong etc. So what does a web app that needs high quality print output do? Here is what Google Docs does when you click their "Print" button:

 

+ Converts the file to PDF.

+ Load the newly converted PDF in Acrobat (or another PDF viewer plugin)

+ Triggers the Acrobat print dialog

 

So they download PDF to the client then use a  client program to print the file. Now because WebViewer's XOD is just XPS (http://en.wikipedia.org/wiki/Open_XML_Paper_Specification), and because XPS is the native Windows Print Spool Format there is no need for any server side conversion and the XOD file can be directly viewed and printed on any Windows machine without any software installs! Of course, if required you can also download the original PDF (or is required use PDFNet's XPS to PDF transform function).

 

Another way to print from HTML5 WebViewer is by using 'Document.LoadCanvasAsync()'  (http://www.pdftron.com/pdfnet/webviewer/demo/html5/doc/symbols/CoreControls.Document.html#LoadCanvasAsync) to render an image for given page. The resulting image can then be printed - similar to print button on news web sites http://stackoverflow.com/questions/4716756/printing-just-canvas-element-on-a-page, but it is very likely that it would not perform well on mobile.

 

So the best option is to add extra button to download the Original PDF (or XPS – on Windows).
 
Reply all
Reply to author
Forward
0 new messages