$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 .
问题是后面的代码
$pdf->merge('browser',‘plete.pdf’,'L');
行下的任何代码都不会运行。
为什么?
发布于 2017-04-09 13:44:01
最后,我解决了我的问题。
只需遵循下面的代码
$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 first, and store in $result variable
$result = $pdf->merge('string', 'complete.pdf', 'L');
// Deleting files
Storage::delete('pdfTemp/myFile01.pdf');
Storage::delete('pdfTemp/myFile02.pdf');
//And finnaly get the string and Display to BROWSER as PDF
header('Content-Type: application/pdf');
echo $result;希望它能帮助别人。
https://stackoverflow.com/questions/43307283
复制相似问题