我试图使用laravel 5和https://github.com/elibyy/laravel-tcpdf如何使用带有tcpdf laravel 5的刀片视图生成pdf?
我有20页形式写入laravel刀片时,我的客户填写表格,然后点击提交我要生成PDF格式为他和保存
创建PDF我尝试做这样在我的控制器
public function createPDF()
{
$pdf = Input::get('pdf',null);
$company = Input::get('company',null);
$branch = Input::get('branch',null);
$sub_branch = Input::get('sub_branch',null);
$form_type = Input::get('form_type',null);
$form_name = Input::get('form_name',null);
$form_heb_name = Input::get('form_heb_name',null);
$sig_path=FormsController::getSignature_file();
$data=compact('company','branch','sub_branch','form_type','form_name','form_heb_name','sig_path');
Input::flash();
if ($pdf)
{
$pdf = new TCPDF();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->writeHTML(view('forms.'.$company.'.'.$branch.'.'.$sub_branch.'.'.$form_type.'.'.$form_name, $data)->render());
$filename = storage_path().'/forms_pdf/10006/26/4718326/'.$form_name.'.pdf';
$pdf->output($filename, 'I');
return redirect('forms');
}
return view('forms.'.$company.'.'.$branch.'.'.$sub_branch.'.'.$form_type.'.'.$form_name , $data);
}
蝙蝠它不工作是创建2 PDF页面上相互
如何解决它的顶部所有字段?
此外,我想以一种无法编辑的方式保存pdf文件,我该怎么做?
谢谢。
难道你找到了解决办法? – Notflip
不用tcpdf我用[link](https://github.com/barryvdh/laravel-snappy) –
好吧谢谢! – Notflip