#How to export html blade to pdf?
1 messages · Page 1 of 1 (latest)
So.. what are those issues exactly? Can't really help you if you don't provide any information
I have this invoice page in laravel blade that I want to export to pdf. But I've tried several libraries and it didn't work. I've tried domPDF, snappy, and html2pdf.js
Why didn't those work? Since those are packages intended to solve the problem you're facing; generating PDFs
Most of these types of packages require some PHP extensions to be enabled. Have you got them installed and enabled?
PHP version 7.1 or higher
DOM extension
MBString extension
php-font-lib
php-svg-lib
It just returns a raw pdf content instead of download the pdf file
How do I check these extension and lib if its installed and enabled or not?
Well its basically just this
return $pdf->download('invoice.pdf');```
I'm using domPDF
Try it without ->output()
Its still the same just return raw pdf like this and didn't download pdf
Is it possible because I have old version laravel. My laravel is 5.8
My laravel is 5.8
You should probably focus on other things then, that version is 5 years old and hasn't received any security updates for 4 years. It also means you're likely using PHP 7.3 (or older), which ended support like 2.5 years ago and doesn't get security updates either
Any idea what could possibly cause this issue? I couldn't find any error logs but it just returns raw pdf content