qpdfjs pdf.js wrapper for Yii Framework

  1. Feature
  2. Requirements
  3. Installing and configuring
  4. Usage
  5. Parameter
  6. Resource

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

4 0
18 followers
3 829 downloads
Yii Version: Unknown
License: BSD-2-Clause
Category: Others
Developed by: Lucky Vic
Created on: Jun 27, 2013
Last updated: 10 years ago

Downloads

show all

Related Extensions