- 🇬🇧United Kingdom matt b
I think the answer is here: https://github.com/dompdf/dompdf/wiki/About-Fonts-and-Character-Encoding
- Status changed to Postponed: needs info
5 months ago 11:24pm 11 June 2024 - 🇺🇸United States smustgrave
Could more steps be added by chance? But thanks to @Matt B in #3 seems like this might be an issue with dompdf maybe an issue should be logged there instead?
- 🇮🇹Italy apaderno Brescia, 🇮🇹
Reading About Fonts and Character Encoding, I gather it could be an issue with this module, which should reference the correct font in the used CSS stylesheet.
- Issue was unassigned.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
The attached screenshot does not show the described bug. It just shows the screenshot of part of a node, where the PDF link is present.
- Status changed to Active
5 months ago 6:59pm 13 June 2024 - 🇮🇹Italy apaderno Brescia, 🇮🇹
Also, what does dropping between letters exactly mean?
- 🇺🇸United States smustgrave
Not familiar with other languages but I took that as the letter appears slightly lower then expected/not centered with rest of the word. But just how I took it.
- Status changed to Postponed: needs info
5 months ago 7:20pm 14 June 2024 - 🇮🇹Italy apaderno Brescia, 🇮🇹
That would be dropping letters.
Given the screenshot does not show exactly what the bug is, and the description is not clear, this needs more information from the OP. - 🇬🇧United Kingdom matt b
I cannot comment for the OP, but I'm still struggling to get output in Farsi / Persian.
I've set
* { font-family: 'DejaVu Sans', sans-serif, Courier; }
In the css, and whilst it now produces characters instead of lots of ??? (one or two specific issues in my header, which I'll look at separately), but when I copy and translate the text back to english using google translate it's clearly not giving me the original text, and when I compare to the original text in Drupal it is different - something is happening in the PDF production process.
This text (from both the node content and .../debug) looks correct (probably reverts to LTR here) :
در اشعيا باب ۵۵ آيه ٣ خدا از ما ميخواهد که به نزد او بياييم، به او گوش دهيم و زندگی واقعی پيدا کنيم .
خدا نمی خواهد ما هلاک شويم. او می خواهد که ما در پادشاهی او باشيم و به پسر عزيزش عيسی اين امکان را داده است تا او اين امر را فراهم کند.But is displayed in the PDF as
هب ،مييايب وا دزن هب هک دهاوخيم ام زا ادخ ٣هيآ ۵۵باب ايعشا رد
. مينک اديپ یعقاو یگدنز و ميهد شوگ وا
وا یهاشداپ رد ام هک دهاوخ یم وا .ميوش کاله ام دهاوخ یمن ادخ
وا ات تسا هداد ار ناکما نيا یسيع شزيزع رسپ هب و ميشاب
. دنک مهارف ار رما نيا - 🇬🇧United Kingdom matt b
I think the following is relevant, and this is probably a support request rather than a bug fix due this being a feature not supported by DomPDF?
https://github.com/dompdf/dompdf/issues/2619
https://github.com/dompdf/dompdf/pull/2107Also, google about, I got the hint that this may not be an issue with Wkhtmltopdf, so I might give that a try (something for another day!)
- 🇬🇧United Kingdom matt b
I've switched to using the Entity PDF module, which uses mpdf as the engine. It is rendering Arabic characters fine.
- 🇯🇴Jordan hamza aldahoud
You can use phpwkhtmltopdf library https://github.com/mikehaertl/phpwkhtmltopdf
- 🇩🇪Germany jurgenhaas Gottmadingen
I'm having the same issue with simple German umlauts, they get printed as 2-byte character combination, as if dompdf is able to deal with UTF-8. Switching to wkhtmltopdf engine solves the issue, though.
- 🇭🇺Hungary peri22
Hello, I had the same problem with some characters. I have set the font-family and created a patch to fix the character encoding.
- 🇧🇪Belgium johanvdr
The patch throws this error in php 8.2.x
Deprecated function: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated;
Handling HTML entities via mbstring is deprecated in PHP 8.2.
- 🇧🇪Belgium johanvdr
I have updated the patch from #19 🐛 not correct export character Postponed: needs info . There was a small issue with the conversion map array.
- 🇧🇪Belgium johanvdr
Actually there is an even more simple fix that worked for me without any patch. Set the metatag header in entity-print.html.twig.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>