[GH-ISSUE #14715] issue: Garbled text appears when exporting to PDF #32872

Closed
opened 2026-04-25 06:43:53 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @gongshaojie12 on GitHub (Jun 6, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14715

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

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

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

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.

Image

Chat history

Image

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

Originally created by @gongshaojie12 on GitHub (Jun 6, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/14715 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### 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 - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### 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. ![Image](https://github.com/user-attachments/assets/84575c61-6036-4448-b212-e160b5b5e813) **Chat history** ![Image](https://github.com/user-attachments/assets/796eaa36-6943-4471-aedf-e5c146d0d2eb) **exported PDF** [chat-汽车对比 🚗 长安 vs MG.pdf](https://github.com/user-attachments/files/20621176/chat-.vs.MG.pdf) How can I fix the garbled text issue? ### Steps to Reproduce None ### Logs & Screenshots None ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-25 06:43:53 -05:00
Author
Owner

@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 )

<!-- gh-comment-id:2948399867 --> @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](https://github.com/open-webui/open-webui/blob/53764fe64884da147359e54ed6d9607fe57f1600/backend/open_webui/utils/pdf_generator.py#L16)) 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 ](https://github.com/open-webui/open-webui/blob/53764fe64884da147359e54ed6d9607fe57f1600/src/lib/components/layout/Sidebar/ChatMenu.svelte#L84)& for [not stylized](https://github.com/open-webui/open-webui/blob/53764fe64884da147359e54ed6d9607fe57f1600/src/lib/components/layout/Sidebar/ChatMenu.svelte#L156) redirect to https://github.com/open-webui/open-webui/blob/53764fe64884da147359e54ed6d9607fe57f1600/backend/open_webui/routers/utils.py#L91 (/pdf endpoint that route to pdf_generator.py )
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#32872