Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 2.1.15 - Invoice PDF & shipment PDF does not support Chinese Language. #18260

Open
SathishDreamorbit opened this issue Sep 26, 2018 · 13 comments
Labels
Area: Content Component: Sales Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.

Comments

@SathishDreamorbit
Copy link

SathishDreamorbit commented Sep 26, 2018

Preconditions

  1. Updated(09/19/2019): Still actual on 2.3-develop
  2. Magento version 2.1.9
  3. Magento version 2.1.15

Steps to reproduce

  1. Login to admin panel and go to Sales -> Order
  2. Search the completed order and click "view"
  3. Select "Invoice" or "Shipments" tab and then click respective "Print" option.

Expected result

  1. In Invoice and Shipment the billing address should be readable.

Actual result

  1. Chinese characters are replaced by some other symbols
    invoice_pdf
@magento-engcom-team
Copy link
Contributor

Hi @SathishDreamorbit. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@SathishDreamorbit do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 26, 2018
@ghost ghost self-assigned this Sep 26, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Sep 26, 2018

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Component: Sales Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Sep 26, 2018
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Sep 26, 2018
@magento-engcom-team
Copy link
Contributor

@engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-95260, MAGETWO-95261 were created

@ghost ghost removed their assignment Sep 26, 2018
@dklapan
Copy link

dklapan commented Sep 27, 2018

This is a problem with fonts. The stock font is FreeSerif and it doesn't have chinese characters, you can simply edit this piece of code:

    protected function _setFontRegular($object, $size = 7)
    {
        $font = \Zend_Pdf_Font::fontWithPath(
            $this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/custom_font.ttf')
        );
        $object->setFont($font, $size);
        return $font;
    }

in app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php line 856

and in lib/internal/GnuFreeFont/ you add your font with chinese characters.

@rishabhchd19
Copy link

It doesn't support Hindi either. The symbol of Rupees is displayed as []?

@SathishDreamorbit
Copy link
Author

@magento team,

Let me know the status of the issue.

@dklapan I have tried the steps. However, I didn't get the respective font files for Chinese language. Could you please share the font files if you have.

@ghost
Copy link

ghost commented Oct 30, 2018

Hi @SathishDreamorbit You don't need this files just copy paste this -> 蔣介石蔣介石蔣介石蔣介石蔣介石蔣介石蔣介石蔣介石蔣介石蔣介石

@SathishDreamorbit
Copy link
Author

@engcom-backlog-nazar
Could you please explain the steps in detail?

@ghost
Copy link

ghost commented Oct 30, 2018

@SathishDreamorbit oh.. sorry i'm confusing a little bit, I thought you need steps to reproduce :)

1 - get font with chinese characters.
2 - put in to lib/internal/GnuFreeFont/
3 - in app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php line 856
 change $this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/FreeSerif.ttf')to -> 
$this->_rootDirectory->getAbsolutePath('lib/internal/GnuFreeFont/add your font with chinese characters..ttf')

@SathishDreamorbit
Copy link
Author

@engcom-backlog-nazar

Yes, I have tried the solution. But we are unable to get the supported Chinese Characters font files. In Google, we did not receive any Chinese Font file with .ttf format. If we convert and upload it, then its not readable one and throwing an error in ZendFramework.

For Existing Magento 2 website, we cannot override framework.

@engcom-Bravo engcom-Bravo self-assigned this Sep 18, 2019
@m2-assistant
Copy link

m2-assistant bot commented Sep 18, 2019

Hi @engcom-Bravo. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@magento-engcom-team magento-engcom-team added this to Ready for Dev in Community Backlog Mar 24, 2020
@sidolov sidolov added this to Ready for Grooming in Low Priority Backlog Sep 3, 2020
@sidolov sidolov added this to Ready for Development in Low Priority Backlog Sep 24, 2020
@ghost ghost removed this from Ready for Dev in Community Backlog Oct 20, 2020
@ghost ghost removed this from Ready for Development in Low Priority Backlog Oct 20, 2020
@ghost ghost removed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Oct 20, 2020
@engcom-Bravo engcom-Bravo added the Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch label Nov 5, 2020
@Pavel-Fekete
Copy link

Still facing this issue on 2.4-develop

@gabrieldagama gabrieldagama added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Nov 19, 2020
@m2-community-project m2-community-project bot added this to Ready for Development in High Priority Backlog Nov 19, 2020
@engcom-Hotel engcom-Hotel added Area: Content Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Aug 25, 2021
@github-jira-sync-bot
Copy link

❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-833

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Content Component: Sales Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
High Priority Backlog
  
Ready for Development
Development

No branches or pull requests

10 participants