Skip to content

Instantly share code, notes, and snippets.

@radmiraal
Created April 9, 2013 08:32
Show Gist options
  • Save radmiraal/5344015 to your computer and use it in GitHub Desktop.
Save radmiraal/5344015 to your computer and use it in GitHub Desktop.
public function showAction() {
if ($this->request->getFormat() === 'pdf') {
header('Content-Type: application/pdf');
$pdf = new \Knp\Snappy\Pdf('/usr/bin/wkhtmltopdf.sh');
echo $pdf->getOutputFromHtml($this->view->render());
return '';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment