xsuchy09/nette-pdf-response

v1.0.0 2020-10-05 07:28 UTC

This package is auto-updated.

Last update: 2024-12-05 16:17:17 UTC


README

PdfResponse for Nette.

Install

composer require xsuchy09/nette-pdf-response

Usage

class SomePresenter extends BasePresenter
{
	public function actionDefault()
	{
		// $pdfCreator is yours pdf library
		$pdfCreator = new ...
		//  which will return pdf as data here
		$data = $pdfCreator->getData();

		$response = new \xsuchy09\Application\Responses\PdfResponse($data, 'download.pdf');
		$this->sendResponse($response);
	}
}