paper.js/examples/Node.js/SVGImport.js

20 lines
583 B
JavaScript
Raw Normal View History

var paper = require('paper'),
2014-08-16 13:24:54 -04:00
path = require('path'),
fs = require('fs');
paper.setup(new paper.Size(300, 600));
paper.project.importSVG('file://' + path.resolve(__dirname, 'in.svg'), {
onLoad: function(item) {
2014-08-16 13:24:54 -04:00
paper.view.exportFrames({
amount: 1,
directory: __dirname,
onComplete: function() {
console.log('Done exporting.');
},
onProgress: function(event) {
console.log(event.percentage + '% complete, frame took: ' + event.delta);
}
});
}
});