-
-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathdemo16.js
More file actions
36 lines (28 loc) · 1.14 KB
/
Copy pathdemo16.js
File metadata and controls
36 lines (28 loc) · 1.14 KB
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
"use strict";
// Tests to verify that "\n" in lines break the line properly...
var Report = require('../lib/fluentReports' ).Report;
var displayReport = require('./reportDisplayer');
var pageHeader = function(r) {
r.fontSize(9);
r.print("the Top Left band should print 4 lines, and is now working!");
r.band([
{data: 'Seriously famous Favorite\nIce Cream', width: 70, align: 'left'},
{data: 'Least Favorite Ice Cream', width: 70, align: 'right'}
], {fontBold: true, wrap: true, border: 1});
};
var detail = function(r, row) {
r.fontsize(9);
r.band([
{data: row.favorite, width: 70, align: 'left'},
{data: row.least, width: 70, align: 'right'}
],{border: 1});
};
var report = new Report("demo16.pdf", {font: "Arimo"})
.registerFont("Arimo", {normal: __dirname+'/Fonts/Arimo-Regular.ttf', bold: __dirname+'/Fonts/Arimo-Bold.ttf', 'italic': __dirname+'/Fonts/Arimo-Italic.ttf'})
.data([{favorite: 'Butter Pecan', least: 'Pistachio'}])
.pageHeader(pageHeader)
.detail(detail);
report.render((err, name) => {
const testing = {images: 1};
displayReport(err, name, testing);
});