I am using knp snappy bundle in symfony 2 ,when I tried this code below i get the error "The exit status code '127' says something went wrong: stderr: "sh: 1: /usr/local/bin/wkhtmltopdf: not found " stdout: "" command: /usr/local/bin/wkhtmltopdf --lowquality '/tmp/knp_snappy5730ffc6454157.04526188.html' '/tmp/knp_snappy5730ffc6454549.48294109.pdf'."
public function showtestAction()
{
$html = $this->renderView('CondorsTnMallBundle:SimpleVisitor:test.html.twig');
return new Response(
$this->get('knp_snappy.pdf')->getOutputFromHtml($html),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="file.pdf"'
)
);
}
wkhtmltopdf
. – malcolmwhich wkhtmltopdf
in console and change path in knp snappy configuration. – malcolm