Threaded View
-
26 Aug 2012 1:00 AM #1
A PDF Viewer Panel - No Browser Plugin required, pure JavaScript
A PDF Viewer Panel - No Browser Plugin required, pure JavaScript
Ext.ux.panel.PDF
A PDF Viewer Panel for the Sencha Touch 2 Framework - No Browser Plugin required, pure JavaScript.
It renders one page at once because of rendering speed. The page scale can be changed by using multitouch gestures like the Zoom-Gesture or Pinch-To-Zoom.
PDF Rendering is done using the great Mozilla PDF.js Library (https://github.com/mozilla/pdf.js).
By now the rendering speed isn´t very good. Take care by changing the maxPageScale config! I hope this is getting better with future development of mozilla´s PDF.JS.
The rendered page looks a bit blurry. This can be fixed by applying a sharpening filter on the rendered canvas. But this will cost some more cpu time, because we cant use WebGL by now.
Github Project
https://github.com/SunboX/st2_pdf_panel
Usage
Code:Ext.application({ views : [ 'Ext.ux.panel.PDF' ], launch: function() { Ext.Viewport.add({ xtype : 'pdfpanel', fullscreen: true, layout : 'fit', src : 'http://cdn.mozilla.net/pdfjs/tracemonkey.pdf', // URL to the PDF - Same Domain or Server with CORS Support }); } });
Examples
For an demo, please visit http://SunboX.github.com/st2_pdf_pan.../SimpleViewer/
Single page demo: http://SunboX.github.com/st2_pdf_panel/demo/NoToolbar/Water is coffee with javascript turned off.


Reply With Quote