Incorrect encoding when exporting to pdf
Attempted Debugging
- [x] I have read the debugging page
Searched GitHub Issues
- [x] I have searched GitHub for the issue.
Describe the Scenario
Hi! When exporting a document in PDF format, the encoding of the headings breaks: in Cyrillic, I see "?????" instead. I searched for a solution on Github, but couldn't find one. Please, help me: what's wrong and what can be fixed?
Exact BookStack Version
BookStack v25.07
Log Content
Hosting Environment
Ubuntu 22.04, PHP 8.3.19, ~# locale LANG=ru_RU.UTF-8 LANGUAGE= LC_CTYPE="ru_RU.UTF-8" LC_NUMERIC="ru_RU.UTF-8" LC_TIME="ru_RU.UTF-8" LC_COLLATE="ru_RU.UTF-8" LC_MONETARY="ru_RU.UTF-8" LC_MESSAGES="ru_RU.UTF-8" LC_PAPER="ru_RU.UTF-8" LC_NAME="ru_RU.UTF-8" LC_ADDRESS="ru_RU.UTF-8" LC_TELEPHONE="ru_RU.UTF-8" LC_MEASUREMENT="ru_RU.UTF-8" LC_IDENTIFICATION="ru_RU.UTF-8" LC_ALL=
I met this truoble too, but I don't know how to solve it.
BookStack uses dompdf as the PDF export engine. You can find a solution at https://github.com/dompdf/dompdf?tab=readme-ov-file#about-fonts--character-encoding.
To zhang-nianqiang You should give detail link, and we all know that bookStack uses dompdf as the PDF export engine. What you given is unuseful.
Switching to WKHTMLTOPDF helped me