Skip to content

A PDF Viewer Panel for the Sencha Touch 2 Framework - No Browser Plugin required, pure JavaScript.

License

Notifications You must be signed in to change notification settings

aflext/st2_pdf_panel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Usage

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_panel/demo/SimpleViewer/

Single page demo: http://SunboX.github.com/st2_pdf_panel/demo/NoToolbar/

PhoneGap/Cordova


Because of a bug in previous versions of PhoneGap, this extension will only run in PhoneGap greater or equal 2.1.0

A demo of working with local files bundled together with a "native" app could be found in /demo/LocalFileSystem/

About

A PDF Viewer Panel for the Sencha Touch 2 Framework - No Browser Plugin required, pure JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published