Inlined SVG not displayed in exported HTML and PDF documents #1262

Closed
opened 2026-02-05 00:26:07 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @mt0erfztxt on GitHub (Jul 17, 2019).

Describe the bug
Inlined remote SVG files not displayed in pages exported into HTML or PDF. For PDF export the issue appears only when wkhtmltopdf is used. I checked exported HTMLs in Chrome, Firefox and Edge browsers and document contains IMG tag with some SVG data (see attached screenshot from Chrome).

Steps To Reproduce

  1. Create new page with following content using Markdown editor:
# PNG file
![Example](https://file-examples.com/wp-content/uploads/2017/10/file_example_PNG_500kB.png)

# SVG file
![Compass](https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/compass.svg)
  1. Export page as 'Contained Web File' or 'PDF File'
  2. Open exported document
  3. Observe PNG and no SVG in HTML or PDF (wkhtmltopdf only) document

Expected behavior
Both PNG and SVG files displayed in exported document.

Screenshots
HTML export (from Chrome)
page-exported-as-html

PDF export (dompdf)
page-exported-as-pdf-using-dompdf

PDF export (wkhtmltopdf)
page-exported-as-pdf-using-wkhtmltopdf

Your Configuration:

  • Exact BookStack Version: v0.26.1
  • PHP Version: 7.1
  • Hosting Method: Docker (solidnerd/bookstack:0.26.1)

Additional context
Archive with page exported into HTML and PDF (dompdf and wkhtmltopdf) exported-pages.zip.

Originally created by @mt0erfztxt on GitHub (Jul 17, 2019). **Describe the bug** Inlined remote SVG files not displayed in pages exported into HTML or PDF. For PDF export the issue appears only when wkhtmltopdf is used. I checked exported HTMLs in Chrome, Firefox and Edge browsers and document contains `IMG` tag with some SVG data (see attached screenshot from Chrome). **Steps To Reproduce** 1. Create new page with following content using Markdown editor: ```md # PNG file ![Example](https://file-examples.com/wp-content/uploads/2017/10/file_example_PNG_500kB.png) # SVG file ![Compass](https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/compass.svg) ``` 2. Export page as 'Contained Web File' or 'PDF File' 3. Open exported document 4. Observe PNG and no SVG in HTML or PDF (wkhtmltopdf only) document **Expected behavior** Both PNG and SVG files displayed in exported document. **Screenshots** HTML export (from Chrome) ![page-exported-as-html](https://user-images.githubusercontent.com/12785564/61353954-7269cb80-a88a-11e9-85e7-a1e57e6ec6c2.png) PDF export (dompdf) ![page-exported-as-pdf-using-dompdf](https://user-images.githubusercontent.com/12785564/61354080-bc52b180-a88a-11e9-92d8-9eec05985942.png) PDF export (wkhtmltopdf) ![page-exported-as-pdf-using-wkhtmltopdf](https://user-images.githubusercontent.com/12785564/61354100-cffe1800-a88a-11e9-86a2-ae844f5f14d4.png) **Your Configuration:** - Exact BookStack Version: v0.26.1 - PHP Version: 7.1 - Hosting Method: Docker (solidnerd/bookstack:0.26.1) **Additional context** Archive with page exported into HTML and PDF (dompdf and wkhtmltopdf) [exported-pages.zip](https://github.com/BookStackApp/BookStack/files/3400571/exported-pages.zip).
OVERLORD added the 🐛 Bug🏭 Back-End labels 2026-02-05 00:26:07 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 18, 2019):

Thanks for reporting @mt0erfztxt with nice clear instructions.

I've just pushed some changes in 1e7df28238 to fix the data type set on SVG img tags which should allow them to display correctly in HTML exports (This will be in BookStack v0.27).

Unfortunately there still seems to be some issues for such SVG images when exporting to PDF via WKHTML which I think is related to wkhtmltopdf/wkhtmltopdf#3186 therefore will need a little more work at some point.

@ssddanbrown commented on GitHub (Jul 18, 2019): Thanks for reporting @mt0erfztxt with nice clear instructions. I've just pushed some changes in 1e7df28238f5babd66afe90573d9a9a201c57475 to fix the data type set on SVG img tags which should allow them to display correctly in HTML exports (This will be in BookStack v0.27). Unfortunately there still seems to be some issues for such SVG images when exporting to PDF via WKHTML which I think is related to wkhtmltopdf/wkhtmltopdf#3186 therefore will need a little more work at some point.
Author
Owner

@mt0erfztxt commented on GitHub (Sep 23, 2019):

Updated setup to use solidnerd/bookstack:0.27.4-1 and now SVG image displayed in document exported as HTML. Thank you!

@mt0erfztxt commented on GitHub (Sep 23, 2019): Updated setup to use `solidnerd/bookstack:0.27.4-1` and now SVG image displayed in document exported as HTML. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1262