我想从包含高度图的树枝视图生成一个PDF文件高度图不显示在PDF文件中。为什么?任何建议
$html = $this->render('AcmequizBundle:Resultat:show.html.twig', array(
'entity' => $entity,
'chart'=>$ob
));
return new Response(
$this->get('knp_snappy.pdf')->getOutputFromHtml($html,array('encoding'=>'UTF-8','enable-javascript' => true,'images' => true)),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="Rapport.pdf"'
)
);
Highcharts是一个JS库,它使用客户端浏览器生成图表。您应该在服务器端生成任何图像格式的图表,并将其包含到PDF分支模板中。
关于服务器端图表生成的一些信息:http://www.highcharts.com/component/content/article/2-articles/news/52-serverside-generated-charts