Bookstack: Inlined SVG not displayed in exported HTML and PDF documents

Created on 17 Jul 2019  路  2Comments  路  Source: BookStackApp/BookStack

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.

Bug Back-End

Most helpful comment

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

All 2 comments

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tpetrauskas picture tpetrauskas  路  4Comments

Legoracers picture Legoracers  路  3Comments

spacesven picture spacesven  路  3Comments

stuartajd picture stuartajd  路  4Comments

mackcoding picture mackcoding  路  3Comments