diecoding/yii2-pdfjs Previewer PDF File with PDF.js for Yii2

Yii2 PDF.js ¶

  1. Table of Contents
  2. Instalation
  3. Dependencies
  4. Usage

Previewer PDF File with PDF.js for Yii2

Latest Stable Version Total Downloads Latest Stable Release Date Quality Score Build Status License PHP Version Require

Yii2 PDF.js uses PDF.js
Demo: https://mozilla.github.io/pdf.js/web/viewer.html

Table of Contents ¶

Instalation ¶

Package is available on Packagist, you can install it using Composer.

composer require diecoding/yii2-pdfjs '^1.0'

or add to the require section of your composer.json file.

'diecoding/yii2-pdfjs': '^1.0'

Dependencies ¶

Usage ¶

Setup Module ¶
...
'modules'=>[
  'pdfjs' => [
       'class' => \diecoding\pdfjs\Module::class,
   ],
],
...

Views ¶
Basic Usage ¶
echo \diecoding\pdfjs\PdfJs::widget([
    'url' => '@web/uploads/dummy.pdf',
]);
Direct Url with Full Toolbar Section ¶
echo Url::to(["/pdfjs", 'file' => Url::to('@web/uploads/dummy.pdf', true)], true);
Custom Attribute ¶
echo \diecoding\pdfjs\PdfJs::widget([
    'url' => '@web/uploads/dummy.pdf',
    'options' => [
        'style' => [
            'width' => '100%',
            'height' => '500px',
        ],
    ],
]);
Disable Toolbar Section ¶
echo \diecoding\pdfjs\PdfJs::widget([
    'url' => '@web/uploads/dummy.pdf',
    'sections' => [
        'toolbarContainer' => false,
    ],
]);
1 0
2 followers
3 754 downloads
Yii Version: 2.0
License: MIT
Category: User Interface
Created on: May 20, 2024
Last updated: a year ago
Packagist Profile
Github Repository

Related Extensions