Letters are replaced with question marks or other broken symbols in the PDF. How do I fix it?
The issue is rooting in the external dompdf library our extension is using to convert HTML code into PDF. Sometimes it fails to recognize specific fonts or locales. There are 2 alternative ways to fix this:
1. Switch to mPDF library. Starting from v.1.6.0 of the module, we added support for an additional library that handles non-Latin characters in a better way, the feature is available as a part of an active Product Subscription or Support Subscription. To use it, install a suggested composer package by running the following command:
composer require amasty/module-pdf-custom-subscription-functionality
Once done, navigate to admin area at Amasty > PDF Customizer > Configuration > General and make sure that Enabled option is set to Yes. In the Library for PDF Customization drop-down, select mPDF and save the changes:

2. Add external font to the PDF template while using dompdf library. For some languages, it is possible to find online a matching font that will be correctly interpreted by dompdf:
2.1. If you're facing difficulties with the Chinese locale, please navigate to Marketing → PDF Templates → open the template and add the following code in the Template Styles block:
@font-face {
font-family: font-extra;
src: url( https://github.com/googlefonts/chinese/blob/gh-pages/fonts/SetoFont/setofont.ttf?raw=true) format('truetype');
}
*{ font-family: font-extra !important;}
2.2. In case there's a problem with Arabic characters, please open the template and update the Template Styles block with the code below:
@font-face {
font-family: El Messiri;
src: url(https://github.com/Gue3bara/El-Messiri/blob/master/fonts/ttf/ElMessiri-Bold.ttf?raw=true format('truetype');}
* { font-family: DejaVu Sans, sans-serif; }
Related Articles
How to change CSS styling (for example, background color) in PDF templates?
Using the PDF Customizer module, it is possible to adjust the PDF documents according to your needs. By default, the extension provides 4 pre-configured templates that could be used for each type of the order-related document: Order, Invoice, ...
If I create the invoice with the Magento API, will the PDF be based on the Amasty template?
If our PDF Customizer extension is enabled in the admin area, order-related PDF files will be generated on the Amasty template basis both when invoices are created via API and when they're created manually in the backend.
How do I embed the footer on every page in the multi-page PDF?
In order to place the footer on every page in the multi-page PDF, please go to Marketing > PDF Templates > open the template and add the following code at the beginning of the <body>: <div class="footer"> <p>Footer</p> </div> Once done, apply ...
I want to change logo and text on the PDF in Request a quote plugin. How do I do that?
Kindly note that PNG files are not suitable for logo replacement. For this operation, please use an SVG file converted to base64 encoding. Please follow the steps below to replace the logo image and edit the text on the PDF. Step 1. Head to Amasty → ...
How to fix the Magento 2.4.5 Layered Navigation showing incorrect results issue?
After upgrading Magento to version 2.4.5 you can see the error: TypeError: Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\SearchResultApplier::categoryProductByCustomSortOrder(): Argument #1 ($categoryId) must be of type int, array ...