Download as SVG not working

19 views
Skip to first unread message

권봉서

unread,
Sep 20, 2021, 12:48:51 AMSep 20
to Paper.js
Hi. I made a website using paperJS and working well.
But a few months ago, download as SVG feature is not working suddenly.

https://automata.cafe24.com/roundgear/


And I found paperJS official website is not working too.
(2) click Download as SVG button
(3) Error: Server Error


If someone knows about this kind of problem, share your wisdom.
Thanks.



I log my source code.


$('#export-button').click(function () {
var svg = project.exportSVG({ asString: true });
downloadDataUri({
data: 'data:image/svg+xml;base64,' + btoa(svg),
filename: 'hello.svg'
});
});

function downloadDataUri(options) {
if (!options.url)
$('<form method="post" action="' + options.url
+ '" style="display:none"><input type="hidden" name="filename" value="'
+ options.filename + '"/><input type="hidden" name="data" value="'
+ options.data + '"/></form>').appendTo('body').submit().remove();
}

Mark MacKay

unread,
Oct 5, 2021, 4:54:31 PMOct 5
to Paper.js
It seems the http://download-data-uri.appspot.com/ service is no longer working, I would suggest to use the download attribute on an anchor, like this:

Reply all
Reply to author
Forward
0 new messages