exupero / saveSvgAsPng

Save SVGs as PNGs from the browser.
MIT License
1.09k stars 362 forks source link

Issues with different browsers #10

Closed PjotrC closed 9 years ago

PjotrC commented 9 years ago

Hi exupero,

on Chrome your script is doing well, but I observed some issuses with other browsers:

On Firefox 30.0 small fonts turn into normal sized fonts. On my test page you can see this at the elevation label. Please check: https://dl.dropboxusercontent.com/u/17823304/Climograph/Climograph_test.html

On Opera 12.17 and Internet Explorer 11 the lownload is not working at all.

Hope to not report known issues.

exupero commented 9 years ago

I will investigate the problems with Firefox and Opera.

As far as I know, the script does not work in IE. It throws a security exception when generating the data URI for a canvas. There are unconfirmed reports that it does work, but I've not been able to reproduce.

exupero commented 9 years ago

It looks like Firefox doesn't fully respect unitless font sizes in style tags.

exupero commented 9 years ago

It doesn't appear that Opera 12 fully supports SVG.

On both your page and the test page, Opera 12 throws a DOM exception (SYNTAX_ERR) when executing the following line in jQuery v1.11.1:

div.querySelectorAll("*,:x");

All appears to work in the new version of Opera, which is built atop Chromium.

PjotrC commented 9 years ago

Thank you for pointing out the issue with Firefox.

Btw: What is the difference between "bjpop/saveSvgAsPng" and "exupero/saveSvgAsPng"?

exupero commented 9 years ago

It looks like the bjpop/saveSvgAsPng is an outdated clone of this repo (most recent commit is late June).

Cartman666 commented 9 years ago

Hi,

This script saved my day, however, do you think the IE issue is solvable?

exupero commented 9 years ago

In my testing, IE considers the critical step canvas.toDataURL() to be a security error. It's possible that behavior is configurable, or that a browser extension could disable it, but knowing for certain would take someone more versed in IE than me.