【发布时间】:2017-09-17 02:12:07
【问题描述】:
我尝试从希望在 PDF 中工作的视图中附加一个 pdf 文件。但是当我尝试将此作为 PDF 文件附加到电子邮件中时,我得到了
FileByteStream.php 第 144 行中的 Swift_IoException:无法打开文件 用于阅读 [HTTP/1.0 200 OK Cache-Control: no-cache, private 内容处置:附件;文件名="invoice.pdf" 内容类型: 申请/pdf
有人知道我在哪里做错了吗?提前非常感谢
这里是我的控制器:
公共函数构建() {
$federation = Structure::where('id' , '1')->first();
$structure = Structure::where(['id' => $this->order->structure_id])->first();
$order = $this->order;
$url = url('/cotisationstructure/'.$this->order->id);
$pdf = app('dompdf.wrapper');
$pdf->loadView('cotisation_structure.facturePDFsingle', compact('order' , 'structure' , 'federation'));
return $this->markdown('email.commande' ,compact('federation' , 'structure' , 'url'))
->subject('Nouvelle Achat de Licences sur FFRXIII Licences & Compétitions')
->attach($pdf->download('invoice.pdf'));
}
【问题讨论】:
-
你在使用 barryvdh/laravel-dompdf 吗?
-
是的,我使用 dompdf
标签: laravel