holabs/dompdf

DomPDF bridge for Nette framework

v0.1.1 2020-12-18 10:48 UTC

This package is auto-updated.

Last update: 2024-10-18 18:35:55 UTC


README

DomPDF bridge for Nette framework

Installation

Requirements:

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);
	}

}