#QPdfJs
pdf.js wrapper for Yii Framework
Embedded pdf file in your web using pdf.js library.
- Yii Framework - Yii 1.1 or above
- pdf.js
- 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.
In your view
[php]
$this->widget('ext.pdfJs.QPdfJs',array(
'url'=>$this->createUrl('/file/view',array('id'=>$model->id,'format'=>Files::PDF)),
string $url
: pdf file url
array $options
: optional option to pdf.js viewer
[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,
)
);