【发布时间】:2017-01-17 23:52:29
【问题描述】:
我正在使用带有 snappy 包装器的 Laravel。除了将 PDF 保存到公用文件夹之外,一切正常。我希望它转到另一个文件夹。在 snappy 的 git 站点上没有任何明显的东西,在配置中也没有。 wkhtlptopdf 文档非常稀疏恕我直言。如何更改 $pdf->save() 语句,使其到达我想要的位置?
我的 PDF 是由 laravel 生成的,如下所示:
if( $email == 'email'){
$quotation = $this->quotation->get_PdfQuote($ref);
$pdf = PDF::loadView('quotations/pdf_quotation',compact('quotation') );
$pdf->save($ref.'.pdf'); //THIS SAVES INTO THE PUBLIC FOLDER.
$title = 'Your Quotation';
$firstname = $customer['firstname1'];
$pathtoFile = '/var/www/auburntree/public/'.$ref.'.pdf';
Mail::send('emails.quotation', ['title' => $title, 'firstname'=>$firstname ], function ($m) use($customer,$pathtoFile) {
$m->from('myemail@gmail.com', 'Auburntree');
$m->to($customer['email1'],($customer['firstname1'] . $customer['lastname1']))->subject('Your Quotation');
$m->attach($pathtoFile);
});
Flash::success('The Quote Has Been Saved. An Email has ben sent to the customer ');
return redirect ('quotes');
} else
【问题讨论】:
标签: pdf wkhtmltopdf laravel-snappy