Laravel - barryvdh/laravel-dompdf - Cannot Open in Acrobat Reader via Chrome Extension

Viewed 111

I'm running into an issue with Laravel PDF Generation and the Adobe Acrobat Reader DC Extension in Chrome. With this extension installed, whenever you view a PDF on Chrome, you get a little button that allows you to open the PDF in Adobe Acrobat Reader DC:

enter image description here

For most PDFs, when you click this, it opens the PDF in the App with no issues. For PDFs generated in Laravel with the laravel-pdf DOMPDF Wrapper, when you click the button, an error is generated:

enter image description here

There are no further debugging details, and Google searches are being less-than-useful due to the incredibly specific nature of the combination of the Chrome plugin and Laravel PDF generation.

For reference, this is the code to generate the PDF in Laravel:

$data = $this->generatePdfData();
return PDF::loadView('test', $data)
->setOptions(['dpi' => 300,'orientation' => 'landscape'])
->setPaper('a4', 'landscape')
->stream('test.pdf');

Has anyone seen this issue before?

Also, if there is no fix for this, that is fine; at best this saves one click (directly opening vs download and opening in Acrobat), but figured I would ask anyway.

0 Answers
Related