issue: Client-Side PDF Generation creates huge ( 10MB per page) PDF files with images instead of text #4714

Closed
opened 2025-11-11 16:01:17 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @TheMasterFX on GitHub (Apr 4, 2025).

Check Existing Issues

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

Installation Method

Docker

Open WebUI Version

0.6.0

Ollama Version (if applicable)

0.64

Operating System

Linux

Browser (if applicable)

Chrome, Edge, Firefox

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 listed steps to reproduce the bug in detail.

Expected Behavior

The exported PDF files includes the Text as selectable Text and not images only. File size should be relatively small when only text is in the chat.

Actual Behavior

The exported PDF is around 10 MB per page. The text could not be selected since it is basically a screendump.

Steps to Reproduce

  • Open a chat from history
  • Export PDF

Logs & Screenshots

Firefox-Console output

#2 0ms Starting document clone with size 800x382 scrolled to 0,0 html2canvas-pro.esm.js:8571:30
#2 834ms Document cloned, element located at 0,382 with size 800x656 using computed rendering html2canvas-pro.esm.js:8571:30
#2 834ms Starting DOM parsing html2canvas-pro.esm.js:8571:30
#2 862ms Added image http://localhost:3000/static/favicon.png html2canvas-pro.esm.js:8571:30
#2 878ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30
#2 882ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30
#2 886ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30
#2 890ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30
#2 894ms Added image data:image/svg+xml,%3Csvg%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-width%3D%222.3%22%20viewBox%3D%220%200%2024%2024%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22w-4%20h-4%22%20xmlns%3D%22http%3A%2F%2Fwww. html2canvas-pro.esm.js:8571:30
#2 897ms Added image data:image/svg+xml,%3Csvg%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-width%3D%222.3%22%20viewBox%3D%220%200%2024%2024%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22w-4%20h-4%22%20xmlns%3D%22http%3A%2F%2Fwww. html2canvas-pro.esm.js:8571:30
#2 902ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30
#2 905ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30
#2 909ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.1%22%20stroke%3D%22currentColor%22%20class%3D%22size-4%22%20style%3D%22transition%3A%20all%3B%20--tw- html2canvas-pro.esm.js:8571:30
#2 911ms Starting renderer for element at 0,382 with size 800x656 html2canvas-pro.esm.js:8571:30
#2 911ms Canvas renderer initialized (800x656) with scale 2 html2canvas-pro.esm.js:8571:30
#2 973ms Finished rendering

Additional Information

No response

Originally created by @TheMasterFX on GitHub (Apr 4, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.6.0 ### Ollama Version (if applicable) 0.64 ### Operating System Linux ### Browser (if applicable) Chrome, Edge, Firefox ### 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 listed steps to reproduce the bug in detail. ### Expected Behavior The exported PDF files includes the Text as selectable Text and not images only. File size should be relatively small when only text is in the chat. ### Actual Behavior The exported PDF is around 10 MB per page. The text could not be selected since it is basically a screendump. ### Steps to Reproduce - Open a chat from history - Export PDF ### Logs & Screenshots Firefox-Console output ``` #2 0ms Starting document clone with size 800x382 scrolled to 0,0 html2canvas-pro.esm.js:8571:30 #2 834ms Document cloned, element located at 0,382 with size 800x656 using computed rendering html2canvas-pro.esm.js:8571:30 #2 834ms Starting DOM parsing html2canvas-pro.esm.js:8571:30 #2 862ms Added image http://localhost:3000/static/favicon.png html2canvas-pro.esm.js:8571:30 #2 878ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30 #2 882ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30 #2 886ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30 #2 890ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30 #2 894ms Added image data:image/svg+xml,%3Csvg%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-width%3D%222.3%22%20viewBox%3D%220%200%2024%2024%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22w-4%20h-4%22%20xmlns%3D%22http%3A%2F%2Fwww. html2canvas-pro.esm.js:8571:30 #2 897ms Added image data:image/svg+xml,%3Csvg%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-width%3D%222.3%22%20viewBox%3D%220%200%2024%2024%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22w-4%20h-4%22%20xmlns%3D%22http%3A%2F%2Fwww. html2canvas-pro.esm.js:8571:30 #2 902ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30 #2 905ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.3%22%20stroke%3D%22currentColor%22%20class%3D%22w-4%20h-4%22%20style%3D%22transition%3A%20all%3B%20-- html2canvas-pro.esm.js:8571:30 #2 909ms Added image data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222.1%22%20stroke%3D%22currentColor%22%20class%3D%22size-4%22%20style%3D%22transition%3A%20all%3B%20--tw- html2canvas-pro.esm.js:8571:30 #2 911ms Starting renderer for element at 0,382 with size 800x656 html2canvas-pro.esm.js:8571:30 #2 911ms Canvas renderer initialized (800x656) with scale 2 html2canvas-pro.esm.js:8571:30 #2 973ms Finished rendering ``` ### Additional Information _No response_
GiteaMirror added the bug label 2025-11-11 16:01:17 -06:00
Author
Owner

@Classic298 commented on GitHub (Apr 4, 2025):

I'd also like to note that it seems as it just prints the entire website into a pdf, at least from the looks of it.

Instead of exporting a nicely formatted markdown file with the individual responses, which would be preferrable and would probably also fix the file size issue.

@Classic298 commented on GitHub (Apr 4, 2025): I'd also like to note that it seems as it just prints the entire website into a pdf, at least from the looks of it. Instead of exporting a nicely formatted markdown file with the individual responses, which would be preferrable and would probably also fix the file size issue.
Author
Owner

@tjbck commented on GitHub (Apr 4, 2025):

Open to reviewing PRs but the current behaviour should be the default.

@tjbck commented on GitHub (Apr 4, 2025): Open to reviewing PRs but the current behaviour should be the default.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4714