sharonchoong / svg-exportJS

A Javascript library to export svg charts from the DOM and download them as an SVG file, PDF, or raster image (JPEG, PNG) format. Can be done all in client-side.
MIT License
42 stars 22 forks source link

Download PNG and JPEG returns blank image #18

Open darahsten opened 4 months ago

darahsten commented 4 months ago

Downloading png or jpeg results in a blank page. SVG, PDF, and PNG (SVG string) works fine. These were all previously working until I guess some browser update crashed things.

I tested this on Firefox, Brave and Chromium browsers, all same result. For reference, I use Firefox 126.0.1 on Ubuntu.

The example page also exhibits the same behavior as my local examples. The index.html of the repo can be used for testing.

Below is the obviously blank export.

Circles and rectangles chart.

Does anyone have a suggestion or fix ?

darahsten commented 4 months ago

By using the raw source code, I can see that if we remove computed styles, the png renders okay, although without any images. There is some styles which the browser/canvg is not happy with. I am still trying to figure it out.