qpdfjs

pdf.js wrapper for Yii Framework
20 followers

Feature

Embedded pdf file in your web using pdf.js library.

Requirements

Installing and configuring

  • Download and extract to extension folder.
  • Download latest pdf.js, and copy all files to pdfJs/assets folder. There are several libraries were modified for Yii Framework with prefix yii_* in assets/web/ include in this extension. Overwrite assets/web folder but make sure if yii_* files is not overwritten.

Usage

In your view

$this->widget('ext.pdfJs.QPdfJs',array(
  'url'=>$this->createUrl('/file/view',array('id'=>$model->id,'format'=>Files::PDF)),

Parameter

string $url : pdf file url
array $options : optional option to pdf.js viewer

Default options

$options=Array(
    // Default sidebar state
      'sideBarOpen'=>false,
 
    // ltr = left to right, rtl=right to left
      'direction'=>'ltr',
 
    // Button visible state
      'buttons'=>array(
        'sidebarToggle'=>true,
        'viewFind'=>true,
        'pageUp'=>true,
        'pageDown'=>true,        
        'zoomIn'=>true,
        'zoomOut'=>true,
        'scaleSelect'=>true,
        'presentationMode'=>true,
        'print'=>false,
        'openFile'=>false,
        'download'=>false,
        'viewBookmark'=>false,
        )
    );

Resource

Total 14 comments

#17545 report it
Lucky Vic at 2014/06/30 09:28pm
Example

@newbiedo : i've uploaded working example. You can download and see how configure and use the extension. There is pdf.js library include in example application but the old version. I tried newest pdf.js library but not working well.

#17542 report it
newbiedo at 2014/06/30 10:48am
Where exactly do I put the files for pdf.js?

I have extracted the extension. I am not seeing the files you in assets/web that you mentioned.

#17541 report it
newbiedo at 2014/06/30 10:41am
Clarification on file placement for pdf.js

I have extracted the extension to the protected/extensions folder. I am confused about where to extract the pdf.js in my application.

#17026 report it
Vulkodava at 2014/04/25 08:18am
Extract images and performance issue

Hi, Cool extension.

I have couple questions, though, Can you help me understand why and how if possible I can prevent the browser lagging due to this plugin And can we extract the images in a particular PDF as files?

Thanks

#16355 report it
Arnold Gultom at 2014/02/13 09:11pm
Thanks for the answer

Thank you very much Lucky Vic

#16346 report it
Lucky Vic at 2014/02/13 06:07am
download button

@arnold :

Add more options in your code.

'buttons'=>array(
        'download'=>true
)
#16344 report it
Arnold Gultom at 2014/02/12 11:42pm
No download button

Is there a download button to download the pdf file?

#14689 report it
Will Mendoza at 2013/09/03 02:34pm
thanks for upload demo files

@Lucky Vic thank you very much.

#14674 report it
Lucky Vic at 2013/09/03 12:01am
Update downloaded demo page

@trond: PDF file is only 993KB. Slow loading might due to your javascript.

@peter JK: If you are using firefox, there is no different. :)

@Will Mendoza: I've already upload demo page for this extension. Let me know if doesn't work with your app.

#14572 report it
Will Mendoza at 2013/08/23 01:55pm
Download demo page

Please, How to i can download the demo page?

#13835 report it
Peter JK at 2013/06/30 12:38pm
Nice Extension

Nice extension..

Just curious, what the main different between standard browser pdf viewer with this pdf.js?..

#13826 report it
trond at 2013/06/28 03:10pm
Slow loading

Loading the demo took about 30 seconds. I'm not sure that is because the PDF is very large or if there is another reason.

#13815 report it
Lucky Vic at 2013/06/27 11:42pm
demo page
#13814 report it
Nur Rochim at 2013/06/27 10:37pm
DEMO

Please demo page

Leave a comment

Please to leave your comment.

Create extension