I'm using magento 2 CE 2.1.3
When I'm trying to prin PDF invoice the hebrew words are reversed, for example:
םולש
instead of שלום
.
And also the currency symbol (NIS ₪
) is not showing.
I have seen this issue in several places:
https://stackoverflow.com/questions/25911650/rupee-symbol-not-rendering-properly-on-invoice-pdf-in-magento
How can I display `₹` properly in invoice pdf without changing core files
but these solutions doesn't work on magento 2.
The closest thing I have found to change the font in the PDF is this:
Adding new fonts to Pdf invoice Magento 2?
but I couldn't understand completely what I should place in the AddFontToPdf.php
file…
I'll be glad for some help here..
Thanks.
Best Answer
For this answer: Adding new fonts to Pdf invoice Magento 2?, we can follow
app/code/Vendor/PdfFont/etc/di.xml
app/code/Vendor/PdfFont/Plugin/AddFontToPdf.php
We need to get the font from:
$this->_rootDirectory->getAbsolutePath('lib/internal/Meiryo/Meiryo.ttf')
.However, this way is for drawing item, not for shipping address info. Because the shipping address part used the protected functions to set font style.
vendor/magento/module-sales/Model/Order/Pdf/AbstractPdf.php