-1
我使用PDF斯納皮產生從意見PDF文件Laravel 4Wkhtmltopdf無法使用Laravel的保存()的相對路徑4
我可以使用下載使用此代碼()沒有任何問題和文件中生成,我可以將其保存:
$pdf = PDFSnappy::loadView($pdfView, $dataForPDF);
return $pdf->download('invoice.pdf');
然而,當我嘗試使用此代碼使用保存():
$pathToFile = "invoices/2015/full/invoice.pdf";
$pdf = PDFSnappy::loadView($pdfView, $dataForPDF);
return $pdf->save($pathToFile);
我收到此錯誤信息:
Object of class Barryvdh\\Snappy\\PdfWrapper could not be converted to string
如果我嘗試這樣:
$pathToFile = url() . '/' . "invoices/2015/full/invoice.pdf";
$pdf = PDFSnappy::loadView($pdfView, $dataForPDF);
return $pdf->save($pathToFile);
我收到此錯誤信息:使用WAMP
The output file's directory http://laravel.dev/invoices/2015/full/ could not be created.
在Windows上我,那會是一個問題嗎?
如何將文件保存到我的/public
文件夾中Laravel裏面invoices/2015/full/
?