-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
demo15.js
43 lines (29 loc) · 1.09 KB
/
demo15.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"use strict";
var Report = require('../lib/fluentReports' ).Report;
var displayReport = require('./reportDisplayer');
function printreport() {
var formData = {
today: "Today",
tomorrow: "Tomorrow",
meta: { high: "85", low: '50' }
};
var mainReport = new Report('demo15.pdf', {font: "Arimo"})
.registerFont("Arimo", {normal: __dirname+'/Fonts/Arimo-Regular.ttf', bold: __dirname+'/Fonts/Arimo-Bold.ttf', 'italic': __dirname+'/Fonts/Arimo-Italic.ttf'})
.data(formData)
.pageheader('test')
.footer('test')
.pageFooter('test');
var overviewReport = new Report(mainReport)
.data(formData)
.titleHeader((a,b, c) => {
//console.log("titleHeader", b, c);
});
var introductionReport = new Report(mainReport)
.data(formData);
if (typeof process.env.TESTING === "undefined") { mainReport.printStructure(); }
mainReport.render((err, name) => {
const testing = {images: 1, blocks: ["120,130,300,100"]};
displayReport(err, name, testing);
});
}
printreport();