Last change
on this file since 28914 was 28914, checked in by ak19, 10 years ago |
Supporting javascript libraries and bespoke code written by Steffan to support the von-sparql user interface
|
File size:
454 bytes
|
Line | |
---|
1 | var paper = require('paper'),
|
---|
2 | path = require('path'),
|
---|
3 | fs = require('fs');
|
---|
4 |
|
---|
5 | var canvas = new paper.Canvas(612, 792, 'pdf');
|
---|
6 | paper.setup(canvas);
|
---|
7 | with (paper) {
|
---|
8 | fs.readFile('./in.json', { encoding: 'utf8' }, function (err, data) {
|
---|
9 | if (err)
|
---|
10 | throw err;
|
---|
11 | project.importJSON(data);
|
---|
12 | view.draw();
|
---|
13 | fs.writeFile(path.resolve(__dirname, 'out.pdf'), canvas.toBuffer(), function (err) {
|
---|
14 | if (err)
|
---|
15 | throw err;
|
---|
16 | console.log('Saved!');
|
---|
17 | });
|
---|
18 | });
|
---|
19 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.