Skip to content

Incorrect encoding when exporting to pdf #5872

Closed

Description

@ishaulov

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • 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?

Image

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=

Activity

  1. shmbatom commented on Nov 11, 2025

    @shmbatom

    I met this truoble too, but I don't know how to solve it.

  2. zhang-nianqiang commented on Nov 11, 2025

    @zhang-nianqiang

    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.

  3. shmbatom commented on Nov 11, 2025

    @shmbatom

    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.

  4. Ozilly commented on Nov 30, 2025

    @Ozilly

    Switching to WKHTMLTOPDF helped me

  5. Alexandr-Falcon99 commented on Mar 2, 2026

    @Alexandr-Falcon99

    Переход на WKHTMLTOPDF мне помог.

    I confirm this statement.

  6. hillw3318-ui commented on Apr 14, 2026

    @hillw3318-ui

    I am using the docker version of BookStack (from the linuxserver repository). In my case, the problem was only with the header. So, I go to the container:

    docker exec -it bookstack_app /bin/bash

    then inside the container, I looked at the existing fonts:

    fc-list

    and saw Free Serif.

    Then I just set Custom HTML Head Content to:

    <style>
      * {
        font-family: 'Free Serif', free-serif !important;
      }
    </style>
    

    and PDF Export works correct.

  7. ssddanbrown commented on Apr 22, 2026

    @ssddanbrown
    Member

    I believe this was caused by the issue addressed in #6069.
    The fixes for that will be part of the next feature release.

    Feel free to request this to be opened if still experiencing issues after upgrading to the next feature release (once it becomes available).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions