https://github.com/mitmx/yii2-pdfprint
Load PDF into iframe and call print
https://github.com/mitmx/yii2-pdfprint
Last synced: 5 months ago
JSON representation
Load PDF into iframe and call print
- Host: GitHub
- URL: https://github.com/mitmx/yii2-pdfprint
- Owner: mitmx
- License: mit
- Archived: true
- Fork: true (dixonsatit/yii2-pdfprint)
- Created: 2021-09-28T06:44:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-28T11:23:30.000Z (over 4 years ago)
- Last Synced: 2026-01-11T12:25:55.177Z (5 months ago)
- Language: PHP
- Homepage: http://dixonsatit.github.io/yii2-pdfprint
- Size: 255 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PdfPrint
========
Load PDF into iframe and call print.
Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

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 :
```php
= \dixonstarter\pdfprint\Pdfprint::widget([
'elementClass' => '.btn-pdfprint'
]);?>
```
```html
open
```
in GridView
```php
= 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('',['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'=>'
{print} {view} {update} {delete} ',
'buttons'=>[
'print'=>function($url,$model){
return Html::a('',['pdf/url'],['class'=>'btn-pdfprint btn btn-default','data-pjax'=>'0']);
}
]
],
],
]); ?>
```