holabs / dompdf
DomPDF bridge for Nette framework
Installs: 1 545
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=7.1
- dompdf/dompdf: ^0.8
- nette/di: ^3.0
This package is auto-updated.
Last update: 2024-11-18 18:54:05 UTC
README
DomPDF bridge for Nette framework
Installation
Requirements:
- php 5.6+
- Nette Framework
- dompdf/dompdf
composer require holabs/dompdf
Configuration
extensions: holabs.dompdf: Holabs\DomPDF\Bridges\Nette\DIExtension holabs.dompdf: defaultPaperSize: 'a4' # Same params as \Dompdf\Options. #Look at \Holabs\DomPDF\Bridges\Nette\DIExtension for default values
Using
Usage is same as classic Dompdf but there is factory and response interface
Your Presenter now can looks like this:
<?php namespace App\Presenters; use Holabs\DomPDF\Factory; use Nette\Application\UI\Presenter; class PDFPresenter extends Presenter { /** @var Factory */ public $dompdfFactory; public function actionDefault() { $document = $this->dompdfFactory->create(); $this->sendResponse($document); } }