I am generating DOM PDF in laravel using barryvdh/laravel-dompdf package. It is working fine by rendering the views and HTML elements with readonly mode. But, I am trying to generate fillable / editable PDF so that user can enter details with out opening it in 3rd party editor tools.
Below is the code snippet I am using to generate PDF with barryvdh/laravel-dompdf package.
$file = "Storage/pdf/document.pdf";
$data = array("foo" => "bar");
$view = view('pdf.document', $data);
\PDF::loadHTML($view)->setPaper('A4', 'portrait')->setWarnings(false)-save($file);
I have also tried mpdf niklasravnsborg/laravel-pdf package but this is also opening in readable mode.
$data = [
'foo' => 'bar'
];
$pdf = PDF::loadView('pdf.document', $data);
return $pdf->stream('document.pdf');
Please suggest me if I need to configure any options to this code.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire