desklab / doku

:scroll: Web Editor for WeasyPrint using Markdown
https://doku.desk-lab.de
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Performance issues on Firefox with large documents #32

Open 3j14 opened 4 years ago

3j14 commented 4 years ago

For large documents with many embedded SVGs, the performance suffers by a lot (especially on Firefox). The easiest solution for this would be to change the rendering engine from SVG to HTML5 Canvas. However, this comes with a mayor drawback: the documents are no longer scaleable. HTML5 canvas rendering was used for quite some time at the beginning and has been ditched in favour of SVG.

Another possibility would be to render SVGs inside the document as raster images.

3j14 commented 3 years ago

I now remembered why I didn't use rasterized HTML5 canvases instead of SVGs. The reason for this was the fact that they would not scale well when resizing the window/preview.

The alternative is to rasterize images inside the PDF for "quick previews" with a lower quality (i.e. a draft), while the download button (or bulk download) will yield a print-ready PDF.