Skip to content

Instantly share code, notes, and snippets.

@florinutz
Created April 15, 2014 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florinutz/10739484 to your computer and use it in GitHub Desktop.
Save florinutz/10739484 to your computer and use it in GitHub Desktop.
$pdfEngine = $this->container->get('knp_snappy.pdf');
$response
->setContent($pdfEngine->getOutputFromHtml($html, [
'header-left' => 'nothing',
'header-center' => 'nothing again',
'header-html' => $this->admin->generateUrl('pdf-header', [], true)
]))
->headers->add([
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="wyzbiz_invoice_' . $invoice->getInvoiceNumber() . '.pdf"'
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment