exupero / saveSvgAsPng

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

Up to 9 svgs downloaded at a time #216

Open falali009 opened 5 years ago

falali009 commented 5 years ago

Stylesheet could not be loaded: file:///C:/Users/DaiZhenPeng/Desktop/hanzi-writer-master/demo/styles.css DOMException: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules at file:///C:/Users/DaiZhenPeng/Desktop/hanzi-writer-master/demo/saveSvgAsPng.js:179:30 at Array.map () at styleSheetRules (file:///C:/Users/DaiZhenPeng/Desktop/hanzi-writer-master/demo/saveSvgAsPng.js:177:59) at inlineCss (file:///C:/Users/DaiZhenPeng/Desktop/hanzi-writer-master/demo/saveSvgAsPng.js:202:5) at file:///C:/Users/DaiZhenPeng/Desktop/hanzi-writer-master/demo/saveSvgAsPng.js:270:14

i want donwload 150+ svgs in once time;

falali009 commented 5 years ago

it maybe chrome ‘s question~~ the maxdownloadnum

lifeinchords commented 4 years ago

I got this error too, with only saving one SVG at a time. My error seemed to be related to the 2 Google fonts I have in my index.html entry to Angular app

saveSvgAsPng.js:193 Stylesheet could not be loaded: https://fonts.googleapis.com/css?family=Raleway:400,500,600,700 DOMException: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules

I had a similar issue with another library. Adding crossorigin="anonymous" to any CSS <link> fixed it see: https://github.com/tsayen/dom-to-image/issues/205#issuecomment-395144061