Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?
[X] Yes, it's still reproducable
What version of Laravel Excel are you using?
3.1.30
What version of Laravel are you using?
9.19
What version of PHP are you using?
8.0.2
Describe your issue
Hi there!
When exporting PDF files (using MPDF library) with custom unicode font (Noto Sans), Laravel Excel renders the characters as squares making them unreadable (like the image below).
What I'm actually trying to do is implement a custom unicode font that supports Devanagari in Laravel Excel exported PDFs.
To test for the file, I've created a blade template and created a PDF with just mPDF library and it gets the required result like this:
But when I try to export the same blade view with Laravel Excel, it gets the square characters like the first image shown. I've even tried to set the default font using the WithDefaultStyles concern as shown in the docs, like the image below but couldn't fix the issue:
Am I missing something here or Laravel Excel doesn't support any custom loaded unicode fonts? Would really help if someone could kindly enlighten me on this issue.
How can the issue be reproduced?
Add this package to install mPDF driver and add Noto Sans as the default font of the driver (which is a Devanagari unicode font).
Create a simple blade file with something like the following html table in Devanagari script. Export the PDF with just the mPDF driver using the above package, everything gets rendered as expected. Trying the same with Laravel Excel using the FromView concern (along with explicitly defining the font like the image code above) will return the unreadable square characters.
नाम
स्त्री/पुरुष
उमेर
सुविधा मुस्ताङ्ग
स्त्री
४१
What should be the expected behaviour?
Exporting the PDF with just the standalone mPDF driver using the above package, everything gets rendered as expected. Trying the same with Laravel Excel using the FromView concern should generate the same pdf with the Devanagari unicode characters properly rendered. Maybe there's something missing with Laravel Excel & it's underlying unicode rendering process.
Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?
What version of Laravel Excel are you using?
3.1.30
What version of Laravel are you using?
9.19
What version of PHP are you using?
8.0.2
Describe your issue
Hi there! When exporting PDF files (using MPDF library) with custom unicode font (Noto Sans), Laravel Excel renders the characters as squares making them unreadable (like the image below).
What I'm actually trying to do is implement a custom unicode font that supports Devanagari in Laravel Excel exported PDFs.
To test for the file, I've created a blade template and created a PDF with just mPDF library and it gets the required result like this:
But when I try to export the same blade view with Laravel Excel, it gets the square characters like the first image shown. I've even tried to set the default font using the WithDefaultStyles concern as shown in the docs, like the image below but couldn't fix the issue:
Am I missing something here or Laravel Excel doesn't support any custom loaded unicode fonts? Would really help if someone could kindly enlighten me on this issue.
How can the issue be reproduced?
What should be the expected behaviour?
Exporting the PDF with just the standalone mPDF driver using the above package, everything gets rendered as expected. Trying the same with Laravel Excel using the FromView concern should generate the same pdf with the Devanagari unicode characters properly rendered. Maybe there's something missing with Laravel Excel & it's underlying unicode rendering process.
PDF is handled by PHPSpreadsheet, there's nothing this package can do to improve that. Best to report over there instead.