Skip to content

Instantly share code, notes, and snippets.

@manuakasam
Created November 7, 2013 13:58
Show Gist options
  • Select an option

  • Save manuakasam/7354957 to your computer and use it in GitHub Desktop.

Select an option

Save manuakasam/7354957 to your computer and use it in GitHub Desktop.
DOMPdfModule Default Configuration
return array(
'dompdf_module' => array(
'dpi' => 300
),
)
namespace Yournamespace\Controller;
use DOMPDFModule\View\Model\PdfModel;
use Zend\Mvc\Controller\AbstractActionController;
class PdfController extends AbstractActionController
{
public function testAction()
{
$pdf = new PdfModel();
$pdf->setOption('filename', 'monthly-report'); // Triggers PDF download, automatically appends ".pdf"
$pdf->setOption('paperSize', 'a4'); // Defaults to "8x11"
$pdf->setOption('paperOrientation', 'landscape'); // Defaults to "portrait"
return $pdf;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment