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