1

In my Magento 2 site having three language stores English,Chinese,Chinese Traditional.All working fine But when comming to PDF in chinise orders it was printing boxes what can i do for fixing this problem

enter image description here

Please any help .I fallowed belowed links

https://github.com/magento/magento2/issues/9666

Hebrew words in PDF invoice are reversed and currency symbol not showing

https://www.sonassi.com/blog/knowledge-base/magento-wrong-charset-conversion-from-utf-16be-to-utf-8-is-not-allowed

1

The way I managed to fix it is that I rewrite the

AbstractPdf.php

file

and within that I used a different font file which was compatible with foreign characters.

I updated these functions:-

protected function _setFontRegular()

protected function _setFontBold()

protected function _setFontItalic()
| improve this answer | |
  • Hello @law Which font library have you used for Chinese character? – chirag Jul 4 '18 at 4:59
  • I think I used LinLibertineFont and placed it in lib/internal the entire folder, I also needed to changed the functions wrote above to pick the library – Gagan Jul 4 '18 at 5:14
  • LinLibertineFont, it's default library it is not supported Chinese character. – chirag Jul 4 '18 at 5:18
  • I am sorry, I really do not remember, you see it was posted last year. But I am quite confident I found on internet the same font with chinese compatible version. – Gagan Jul 4 '18 at 5:20
  • Yes you are right magento2 uses default that font, I am really sorry I do not have the link with me right now. – Gagan Jul 4 '18 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.