Is there a way to import svg files into paper.js?

5,520 views
Skip to first unread message

estacado

unread,
Mar 30, 2012, 6:00:43 PM3/30/12
to Paper.js
I have pre-existing svg files containing shapes that I wish to use in
paper.js. Is there a way to do it?

vonKristoff

unread,
Jul 26, 2012, 9:25:53 AM7/26/12
to pap...@googlegroups.com
Im looking to do the same thing. I have a feeling it's something to do with using 'symbols'.

vonKristoff

unread,
Jul 26, 2012, 9:44:48 AM7/26/12
to pap...@googlegroups.com
// from docs
Projects allow the manipluation of the styles that are applied to all newly created items, give access to the selected items, and will in future versions offer ways to query for items in the scene graph defining specific requirements, and means to persist and load from different formats, such as SVG and PDF.

Ryan Beasley

unread,
Jul 26, 2012, 11:30:49 AM7/26/12
to pap...@googlegroups.com
I don't know of an official way to convert SVG to paperjs...see this discussion from March  https://groups.google.com/forum/?fromgroups#!searchin/paperjs/svg/paperjs/PWtGtKw8pq4/dX-oUyNe2PUJ 

If you search this google group, you will see various discussions about the same topic, e.g.,  https://groups.google.com/forum/?fromgroups#!topic/paperjs/X-sJgS3vwr4
That discussion suggests using processingjs to import SVGs into javascript.

Also, there appear to be various tools that convert SVG to postscript (e.g.,  http://cairosvg.org/ ), and then you could try zeffii's PostScript to paperJS converter  https://groups.google.com/forum/?fromgroups#!searchin/paperjs/postscript/paperjs/-fYQUNdi9z0/q1g4ggSHVgsJ 

~Ryan

Felix Turner

unread,
Sep 23, 2013, 1:52:51 PM9/23/13
to pap...@googlegroups.com
Yes. Check docs here: http://paperjs.org/reference/project/#importsvg-node

In the download package there are a bunch of SVG examples.
Reply all
Reply to author
Forward
0 new messages