我想使用storeAs()
,但不起作用(Dompdf库)
如何将转换后的PDF文件放入存储区?
$data = ['discription' => 'tifa'];
$pdf = PDF::loadView('file.viewFile', compact('data'))->storeAs("public/uploud",'filename');
return $pdf->stream("file.pdf");`
答案 0 :(得分:0)
$data = ['discription'=>'tifa'];
$pdf =PDF::loadView('file.viewFile',compact('data'));
$content = $pdf->output();
$x= storage_path("app/public/uploud/anyname.pdf");
file_put_contents($x, $content);
return $pdf->stream(" anyname.pdf");