PHP code example of zetta-code / zend-mpdf
1. Go to this page and download the library: Download zetta-code/zend-mpdf 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/ */
zetta-code / zend-mpdf example snippets
namespace Application\Controller;
use Laminas\Mvc\Controller\AbstractActionController;
use Zetta\ZendMPDF\View\Model\MpdfModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
$mpdf = new MpdfModel();
$mpdf->setOption('paperSize', 'A3') // padrão "A4"
->setOption('paperOrientation', 'landscape'); // Padrão "portrait"
return $mpdf;
}
}