dixonstarter/yii2-pdfprint Load PDF into iframe and call print.

extensioniframeprintpdfprint

PdfPrint

Load PDF into iframe and call print.

Installation

The preferred way to install this extension is through composer.

https://raw.githubusercontent.com/dixonsatit/yii2-pdfprint/master/ezgif.com-video-to-gif.gif

Either run

php composer.phar require --prefer-dist dixonstarter/yii2-pdfprint "*"

or add

"dixonstarter/yii2-pdfprint": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?= \dixonstarter\pdfprint\Pdfprint::widget([
  'elementClass' => '.btn-pdfprint'
]);?>
<a href="url/test.pdf" class="btn-pdfprint">open</a>

in GridView


<?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            [
              'class' => 'yii\grid\SerialColumn',
              'options'=>['style'=>'width:30px;'],
              'contentOptions'=>['class'=>'text-center']
            ],
            // use in column
            [
              'attribute'=>'value',
              'format'=>'html',
              'value'=>function($model){
                return Html::a('<i class="glyphicon glyphicon-print"></i>',['pdf/url'],['class'=>'btn-pdfprint btn btn-default','data-pjax'=>'0']);
              }
            ],
            // use in ActionColumn
            [
              'class' => 'yii\grid\ActionColumn',
              'header'=>'Actions',
              'options'=>['style'=>'width:150px;'],
              'buttonOptions'=>['class'=>'btn btn-default'],
              'template'=>'<div class="btn-group btn-group-sm text-center" role="group">{print} {view} {update} {delete} </div>',
              'buttons'=>[
                'print'=>function($url,$model){
                  return Html::a('<i class="glyphicon glyphicon-print"></i>',['pdf/url'],['class'=>'btn-pdfprint btn btn-default','data-pjax'=>'0']);
                }
              ]
            ],
        ],
    ]); ?>

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

  • 1.317 October 2016
  • 1.126 May 2016
  • 1.026 May 2016
  • 0.525 May 2016

Comments



1.3 is the latest of 4 releases



MIT license
Stats
7 github stars & 3 github forks
10 downloads in the last day
164 downloads in the last 30 days
10293 total downloads