Prestashop: [BOOM-4250] Some characters in invoice pdf show as undefined characters

Created on 22 Aug 2018  Â·  12Comments  Â·  Source: PrestaShop/PrestaShop

This issue has been migrated from the Forge. Read the original ticket here.

  • _Reporter:_ salma.moakhar
  • _Created at:_ Mon, 6 Nov 2017 17:08:28 +0100

Title is self-explanatory. Japanese characters in the invoice PDF are showing as undefined characters . In the attachment these correspond to customization text field values.

1.7.4.0 1.7.4.1 1.7.5.2 1.7.6.1 Bug FO Invoices Major To Do

Most helpful comment

Problem is due to usage a wrong font in PDF caused by wrong iso code

Some language need a special font to print characters: https://github.com/PrestaShop/PrestaShop/blob/1.7.6.x/classes/pdf/PDFGenerator.php#L40

Depending on Language iso code : https://github.com/PrestaShop/PrestaShop/blob/1.7.6.x/classes/pdf/PDFGenerator.php#L138

Root cause is we always send language based on Context : https://github.com/PrestaShop/PrestaShop/blob/1.7.6.x/classes/pdf/PDF.php#L108

So if we are in BO with language English, en iso code will be used and font associated to this iso code do not support this characters

All 12 comments

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ vincentbz
  • _Created at:_ Fri, 24 Nov 2017 15:41:47 +0100

Cela doit s'afficher correctement quelle que soit la langue.

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ marion_francois
  • _Created at:_ Fri, 27 Jul 2018 12:13:11 +0200

Hello Khouloud BELGUITH 

Can you tell me if there is still this issue on 1.7.4.1 ?

Thanks

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ khouloud.belguith
  • _Created at:_ Fri, 27 Jul 2018 12:50:42 +0200

Hi Marion F,

I manage to reproduce the issue with 1.7.4.1.

Best regards, Khouloud

There is still this issue on 1.7.5.0, is there a plan to fix this issue soon?

cc @khouloudbelguith @marionf

Hi @BenTen,

I manage to reproduce the issue with PS1.7.5.2.
image
This issue is added to our bug roadmap.
There are some major issues to solve before this one.
PrestaShop is an open source project, so it can be solved before if someone submits a pull request to solve it.

Thanks!

I hope that someone can fix this issue soon, because invoices for my Japanese customers are dummy.
Delivery Addresses and Billing Addresses are in a _beautiful square mode_.

It can be reproduced also if you order a product with Russian Ruble (symbol: ₽) currency

image

Is this fixed in version 1.7.6.2? Anybody knows what's causing this problem?

Hi @imcoddy,

Sorry, not fixed yet.
PrestaShop is an open-source project, so it can be solved before if someone submits a pull request to solve it.

Thanks!

@khouloudbelguith
I am wondering if anyone knows which part went wrong. IMO it should be the PDF not supporting UTF-8 charset, but I've no idea where to start looking into.
Let me know if you have a clue

Problem is due to usage a wrong font in PDF caused by wrong iso code

Some language need a special font to print characters: https://github.com/PrestaShop/PrestaShop/blob/1.7.6.x/classes/pdf/PDFGenerator.php#L40

Depending on Language iso code : https://github.com/PrestaShop/PrestaShop/blob/1.7.6.x/classes/pdf/PDFGenerator.php#L138

Root cause is we always send language based on Context : https://github.com/PrestaShop/PrestaShop/blob/1.7.6.x/classes/pdf/PDF.php#L108

So if we are in BO with language English, en iso code will be used and font associated to this iso code do not support this characters

Hi
I am using Prestashop 1.7 and In print order I have an awful design.
please help me to have and invoice order like something that I see in this page. Our language is Persian (RTL). please let me have a file to upload in PDF part of my server to solve this
Capture

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wewew85 picture wewew85  Â·  76Comments

krasnycz picture krasnycz  Â·  52Comments

matks picture matks  Â·  53Comments

bm-services picture bm-services  Â·  91Comments

e-perrodon picture e-perrodon  Â·  69Comments