0
votes

I would like you to help me with this problem.

I have some time working with a project in Laravel 5.6. This week I installed the barryvdh / laravel-dompdf package via composer as indicated in the documentation. I added the respective service provider in the config \ app.php file.

When trying to use the package for the first time I get the following error in Chrome: "An error occurred while loading the PDF document"

When I download the document and visualize it with a text editor, I realize that the only thing that is wrong with the file is that it lacks the first line:% PDF-1.3. When adding said line manually the document is "fixed".

To continue testing, I installed a new laravel project, and then I installed the package and created a route with the same code from the previous project. To my surprise, this project does load the PDF document in Chrome.

Please give me some idea of ​​what things I can review.

Thank you very much

1
I think this has nothing to do with the barryvdh / laravel-dompdf package, because the problem still persists with PDF files that were not created with dompdf. I really appreciate any ideas you can give me.Alejandro

1 Answers

0
votes

I have already solved it. The cause of the problem was that the config/app.php configuration file did not have the <?php line at startup, and this was what caused the problem.