PHP code example of yii2assets / yii2-pdfjs

1. Go to this page and download the library: Download yii2assets/yii2-pdfjs library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yii2assets / yii2-pdfjs example snippets


//....

'modules'=>[
  'pdfjs' => [
       'class' => '\yii2assets\pdfjs\Module',
   ],
],

//...


use yii\helpers\Url;


use yii\bootstrap\Modal;
use yii\helpers\Url;

Modal::begin([
    'header' => '<h2>Hello world</h2>',
    'toggleButton' => ['label' => 'click me'],
]);

echo \yii2assets\pdfjs\PdfJs::widget([
  'url' => Url::base().'/downloads/manualStart_up.pdf'
]);

Modal::end();


use yii\helpers\Url;


use yii\helpers\Url;

//....

'modules'=>[
  'pdfjs' => [
       'class' => '\yii2assets\pdfjs\Module',
       'waterMark'=>[
         'text'=>' Yii2 PDF.JS',
         'color'=> 'red',
         'alpha'=>'0.3'
       ]
   ],
],

//...

php composer 

http://app-url/index.php?r=pdfjs&file=download/manualStart_up.pdf