2016-01-29 17:06:31 -05:00
|
|
|
// Please note: When loading paper as a normal module installed in node_modules,
|
|
|
|
// you would use this instead:
|
2017-04-19 14:32:12 -04:00
|
|
|
// var paper = require('paper-jsdom-canvas');
|
2016-02-15 17:59:31 -05:00
|
|
|
var paper = require('../../dist/paper-core.js');
|
2013-05-09 03:23:11 -04:00
|
|
|
|
2016-01-26 05:41:49 -05:00
|
|
|
paper.setup(new paper.Size(300, 600));
|
2016-04-05 02:26:43 -04:00
|
|
|
paper.project.importSVG('in.svg', {
|
2016-01-26 05:41:49 -05:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
2016-04-04 20:55:43 -04:00
|
|
|
},
|
|
|
|
onError: function(message) {
|
|
|
|
console.error(message);
|
2016-01-26 05:41:49 -05:00
|
|
|
}
|
|
|
|
});
|