PDF export issue with Cyrillic text in headings (displayed as question marks) #5354

Closed
opened 2026-02-05 09:59:47 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @VladislavFl on GitHub (Jul 10, 2025).

Describe the Bug

When exporting a page written in Russian (Cyrillic characters) to PDF, the heading text does not render correctly. Instead of the actual characters, the exported PDF shows question marks (e.g. ??????), while the body text appears mostly fine or only partially affected.

Steps to Reproduce

  1. Create a page in BookStack using Cyrillic text, especially in headings.
    Example:
    "Заголовок"

  2. Export the page as PDF using the built-in export function.

  3. Open the PDF file and check the headings.

Expected Behaviour

All Cyrillic text, including headings, should be correctly rendered in the PDF export.

Screenshots or Additional Context

orig:
Image

after export:

Image

This issue likely relates to font support in the PDF generation process. It seems that the font used for headings in the export does not support Cyrillic characters. A possible solution might be to embed a Unicode-compatible font that includes Cyrillic glyphs.

Browser Details

Chrome 138.0.7204.97

Exact BookStack Version

v25.05.2

Originally created by @VladislavFl on GitHub (Jul 10, 2025). ### Describe the Bug When exporting a page written in Russian (Cyrillic characters) to PDF, the heading text does not render correctly. Instead of the actual characters, the exported PDF shows question marks (e.g. ??????), while the body text appears mostly fine or only partially affected. ### Steps to Reproduce 1. Create a page in BookStack using Cyrillic text, especially in headings. Example: "Заголовок" 2. Export the page as PDF using the built-in export function. 3. Open the PDF file and check the headings. ### Expected Behaviour All Cyrillic text, including headings, should be correctly rendered in the PDF export. ### Screenshots or Additional Context orig: <img width="941" height="703" alt="Image" src="https://github.com/user-attachments/assets/ff1a7e6d-16c4-41d9-934b-94d1606e93d0" /> after export: <img width="729" height="615" alt="Image" src="https://github.com/user-attachments/assets/6090c039-3183-417b-8365-24766cbdeadd" /> This issue likely relates to font support in the PDF generation process. It seems that the font used for headings in the export does not support Cyrillic characters. A possible solution might be to embed a Unicode-compatible font that includes Cyrillic glyphs. ### Browser Details Chrome 138.0.7204.97 ### Exact BookStack Version v25.05.2
OVERLORD added the 🐛 Bug label 2026-02-05 09:59:47 +03:00
Author
Owner

@AndryWJ commented on GitHub (Jul 23, 2025):

I also have this problem in version v25.05.1

@AndryWJ commented on GitHub (Jul 23, 2025): I also have this problem in version v25.05.1
Author
Owner

@AndryWJ commented on GitHub (Jul 23, 2025):

Replacing the command with weasyprint helped https://www.bookstackapp.com/docs/admin/pdf-rendering/#pdf-export-command

@AndryWJ commented on GitHub (Jul 23, 2025): Replacing the command with weasyprint helped https://www.bookstackapp.com/docs/admin/pdf-rendering/#pdf-export-command
Author
Owner

@AGARES2101 commented on GitHub (Jul 24, 2025):

Instruction for Fixing PDF Export Issues in BookStack on Ubuntu 24.04 Using WeasyPrint

1. Install Required Dependencies

Open the terminal and run:

sudo apt-get update
sudo apt-get install python3-pip python3-cffi libcairo2 libpango-1.0-0 \
libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info

These libraries are necessary for WeasyPrint to work correctly and to support font rendering.

2. Install WeasyPrint

Option 1: Using pip

sudo pip3 install weasyprint

If you get the “externally-managed-environment” error, it is recommended to use the system package or a Python virtual environment.

Option 2: Using system package

sudo apt install weasyprint

This will install the utility, usually available at /usr/bin/weasyprint.

3. Verify WeasyPrint Installation

Check the version and environment info:

weasyprint --info

You should see details about the version, supported libraries, Python version, and system info.

4. Configure BookStack to Use WeasyPrint

Open the .env configuration file for your BookStack installation:

sudo nano /var/www/bookstack/.env

Add or modify the following line:

EXPORT_PDF_COMMAND="/usr/bin/weasyprint {input_html_path} {output_pdf_path}"

Make sure the path to weasyprint matches the output of the command which weasyprint.

5. Restart BookStack

@AGARES2101 commented on GitHub (Jul 24, 2025): ### **Instruction for Fixing PDF Export Issues in BookStack on Ubuntu 24.04 Using WeasyPrint** ## 1. Install Required Dependencies Open the terminal and run: ```bash sudo apt-get update sudo apt-get install python3-pip python3-cffi libcairo2 libpango-1.0-0 \ libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info ``` These libraries are necessary for WeasyPrint to work correctly and to support font rendering. ## 2. Install WeasyPrint **Option 1: Using pip** ``` sudo pip3 install weasyprint ``` *If you get the “externally-managed-environment” error, it is recommended to use the system package or a Python virtual environment.* **Option 2: Using system package** ``` sudo apt install weasyprint ``` This will install the utility, usually available at `/usr/bin/weasyprint`. ## 3. Verify WeasyPrint Installation Check the version and environment info: ```bash weasyprint --info ``` You should see details about the version, supported libraries, Python version, and system info. ## 4. Configure BookStack to Use WeasyPrint Open the `.env` configuration file for your BookStack installation: ```bash sudo nano /var/www/bookstack/.env ``` **Add or modify the following line:** ```bash EXPORT_PDF_COMMAND="/usr/bin/weasyprint {input_html_path} {output_pdf_path}" ``` **Make sure the path to `weasyprint` matches the output of the command `which weasyprint`.** ## 5. Restart BookStack
Author
Owner

@VladislavFl commented on GitHub (Aug 12, 2025):

@AGARES2101 Thank you, your solution works!

@VladislavFl commented on GitHub (Aug 12, 2025): @AGARES2101 Thank you, your solution works!
Author
Owner

@klavastara commented on GitHub (Oct 31, 2025):

@VladislavFl Получилось настроить по гайду от чувака этого? Я тоже самое сделал, у меня что-то не работает все равно...

@klavastara commented on GitHub (Oct 31, 2025): @VladislavFl Получилось настроить по гайду от чувака этого? Я тоже самое сделал, у меня что-то не работает все равно...
Author
Owner

@VladislavFl commented on GitHub (Oct 31, 2025):

@klavastara да, по этому гайду (https://github.com/BookStackApp/BookStack/issues/5704#issuecomment-3113282312) всё повторил и заработало

@VladislavFl commented on GitHub (Oct 31, 2025): @klavastara да, по этому гайду (https://github.com/BookStackApp/BookStack/issues/5704#issuecomment-3113282312) всё повторил и заработало
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5354