$pdf = new \LynX39\LaraPdfMerger\PdfManage;
$pdf->addPDF(storage_path('public/pdfTemp').'/myFile01.pdf', 'all');
$pdf->addPDF(storage_path('public/pdfTemp').'/myFile02.pdf', 'all');
$pdf->merge('browser', 'complete.pdf', 'L');
// The code below is not running !! why??
Storage::delete('pdfTemp/myFile01.pdf');
Storage::delete('pdfTemp/myFile02.pdf');
基于上面的代码, 我使用PdfMerger for PHP Laravel Framework ...
问题是代码,它位于
之后$ pdf->合并('浏览器',' complete.pdf',' L');
并且该行下方的任何代码都不会运行。
为什么?
答案 0 :(得分:0)
最后,我解决了我的问题..
只需按照以下代码
$pdf = new \LynX39\LaraPdfMerger\PdfManage;
$pdf->addPDF(storage_path('public/pdfTemp').'/myFile01.pdf', 'all');
$pdf->addPDF(storage_path('public/pdfTemp').'/myFile02.pdf', 'all');
// Merge and return to STRING, and store in $result variable
$result = $pdf->merge('string', 'complete.pdf', 'L');
// Deleting files
Storage::delete('pdfTemp/myFile01.pdf');
Storage::delete('pdfTemp/myFile02.pdf');
//Display PDF to BROWSER
header('Content-Type: application/pdf');
echo $result;
希望它能帮助别人。