mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #14715] issue: Garbled text appears when exporting to PDF #32872
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gongshaojie12 on GitHub (Jun 6, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14715
Check Existing Issues
Installation Method
Pip Install
Open WebUI Version
v0.6.13
Ollama Version (if applicable)
No response
Operating System
centos7.9
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Export a PDF without garbled text
Actual Behavior
When I enable the 'Styled PDF Export' feature, the exported PDF of the conversation becomes garbled.
Chat history
exported PDF
chat-汽车对比 🚗 长安 vs MG.pdf
How can I fix the garbled text issue?
Steps to Reproduce
None
Logs & Screenshots
None
Additional Information
No response
@rgaricano commented on GitHub (Jun 6, 2025):
To fix stylized font use (not stylized create pdf with "photo" chat images) it's neccessary refact the function ( similar as is done in backend/open_webui/utils/pdf_generator.py)
It need fonts be added to jspdf object (ref: https://github.com/parallax/jsPDF?tab=readme-ov-file#use-of-unicode-characters--utf-8 ), but i'm afraid that jspdf don't have any method to "fallbackfont" (as fpdf2 does), i don't know if only adding fonts could be solved.
A possible solution is keep jspdf function for stylized pdf & for not stylized redirect to
53764fe648/backend/open_webui/routers/utils.py (L91)(/pdf endpoint that route to pdf_generator.py )