我正在使用Barryvdh/DomPDF
软件包以PDF格式下载页面,但每当我点击按钮下载时,页面都会永久加载而且无法下载。然后我被迫重新启动计算机。我不知道是什么造成的。
我的观点:
<a href="{{url('finance/invoice/printPdf/'.$detail->id) }}" class="btn btn-success">Download PDF</a>
我的控制器:
public function printPdf($id){
//Print this page in PDF
$details = DB::select("select a.id as id, b.name as subsidiary, c.name as client, due_date, invoice_date, invoice_number, order_number,
sub_total, tax, grand_total, notes from sys_invoices as a, sys_organizations as b, sys_clients as c
where a.subsidiary_id = b.id and a.client_id = c.id and a.id = '$id'");
//Get items
$items = DB::select("select * from sys_items where invoice_id = '$id'");
$pdf = PDF::loadView('invoice.invoice', compact('details', 'items'));
return $pdf->download('invoice.pdf');
}