PHP code example of xsuchy09 / nette-pdf-response

1. Go to this page and download the library: Download xsuchy09/nette-pdf-response library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xsuchy09 / nette-pdf-response example snippets


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