我在KnpSnappy Bundle文档中找不到相关的内容,想知道如何在Symfony和KnpSnappy中将我的PDF保存到服务器上,而不是下载到浏览器。请帮忙解决,非常感谢。
Server Path: $pdfFolder = $_SERVER['DOCUMENT_ROOT'].'/symfonydev/app/Resources/account_assets/'.$account_id.'/pdf/';
return new Response(
$this->get('knp_snappy.pdf')->getOutputFromHtml($content),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="'.$pdfFolder.''.strtotime('now').'.pdf"'
)
);