No description, website, or topics provided.
JavaScript PHP
Latest commit 7aa005e Jun 28, 2013 @luckynvic Add Demo page
Add demo page and fix load load pdf.js language library
Permalink
Failed to load latest commit information.
assets/web Version 0.1 Jun 27, 2013
views Add Demo page Jun 28, 2013
.gitattributes Version 0.1 Jun 27, 2013
.gitignore Version 0.1 Jun 27, 2013
QPdfJs.php Version 0.1 Jun 27, 2013
README.md Add Demo page Jun 28, 2013

README.md

QPdfJs

pdf.js wrapper for Yii Framework

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

[php]

$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

[php]
 $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