I am creating a PDF DOM in laravel using the barryvdh / laravel-dompdf package . It works great by creating HTML views and elements with readonly mode. But I'm trying to create a fillable / editable PDF so that the user can enter data by opening it in third-party editors.
Below is the code snippet that I use to create a PDF file with the 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 also tried mpdf niklasravnsborg / laravel-pdf , but it also opens in readable mode.
$data = [
'foo' => 'bar'
];
$pdf = PDF::loadView('pdf.document', $data);
return $pdf->stream('document.pdf');
Please suggest me adjust the settings for this code.
source
share