export to PDF doesn't work in RTL languages like farsi #4293

Open
opened 2026-02-05 08:27:35 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @chezgi on GitHub (Nov 3, 2023).

Describe the Bug

when doing export to PDF and page is written in farsi,
the page layout is LTR, and also it cant handle unicode characters correctly

Steps to Reproduce

use language: farsi
write an page
export to pdf

Expected Behaviour

it must have correct layout for RTL languages.

Screenshots or Additional Context

Screenshot from 2023-11-03 10-55-35

Browser Details

No response

Exact BookStack Version

latest

Originally created by @chezgi on GitHub (Nov 3, 2023). ### Describe the Bug when doing export to PDF and page is written in farsi, the page layout is LTR, and also it cant handle unicode characters correctly ### Steps to Reproduce use language: farsi write an page export to pdf ### Expected Behaviour it must have correct layout for RTL languages. ### Screenshots or Additional Context ![Screenshot from 2023-11-03 10-55-35](https://github.com/BookStackApp/BookStack/assets/309195/a0a24f3a-a331-40fd-a35e-085db37294af) ### Browser Details _No response_ ### Exact BookStack Version latest
OVERLORD added the 🐛 Bug🌍 Translations🚚 Export System labels 2026-02-05 08:27:35 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 5, 2023):

Looking into this, the upstream library we use for PDF generation does not support RTL content.
We do allow WKHTML as another PDF renderer, but that requires sacrificing security, and that project is no longer supported, while it still has issues with RTL from my testing (At least with current BookStack code).

We'd probably need to look to a new optional render at some point (for this and various other issues).

Note: As an alternative for pages you can often use the browser's print-to-pdf option to get a good representative result where desired.

@ssddanbrown commented on GitHub (Dec 5, 2023): Looking into this, the upstream library we use for PDF generation does not support RTL content. We do allow WKHTML as another PDF renderer, but that requires sacrificing security, and that project is no longer supported, while it still has issues with RTL from my testing (At least with current BookStack code). We'd probably need to look to a new optional render at some point (for this and various other issues). Note: As an alternative for pages you can often use the browser's print-to-pdf option to get a good representative result where desired.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4293