@spinajs/templates-pdf 2.0.180 → 2.0.181
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/config/pdf.d.ts +14 -14
- package/lib/cjs/config/pdf.js +16 -16
- package/lib/cjs/index.d.ts +24 -24
- package/lib/cjs/index.js +125 -125
- package/lib/cjs/index.js.map +1 -1
- package/lib/mjs/config/pdf.d.ts +14 -14
- package/lib/mjs/config/pdf.js +14 -14
- package/lib/mjs/index.d.ts +24 -24
- package/lib/mjs/index.js +119 -119
- package/lib/mjs/index.js.map +1 -1
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +6 -6
package/lib/mjs/index.js
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { default as puppeteer } from 'puppeteer';
|
|
11
|
-
import { NotSupported } from '@spinajs/exceptions';
|
|
12
|
-
import { TemplateRenderer, Templates } from '@spinajs/templates';
|
|
13
|
-
import { Config } from '@spinajs/configuration';
|
|
14
|
-
import { Injectable, LazyInject, PerInstanceCheck } from '@spinajs/di';
|
|
15
|
-
import { basename, dirname, join } from 'path';
|
|
16
|
-
import { Log, Logger } from '@spinajs/log';
|
|
17
|
-
import Express from 'express';
|
|
18
|
-
import cors from 'cors';
|
|
19
|
-
import '@spinajs/templates-pug';
|
|
20
|
-
let PdfRenderer = class PdfRenderer extends TemplateRenderer {
|
|
21
|
-
get Type() {
|
|
22
|
-
return 'pdf';
|
|
23
|
-
}
|
|
24
|
-
get Extension() {
|
|
25
|
-
return '.pdf';
|
|
26
|
-
}
|
|
27
|
-
constructor(pdfOptions) {
|
|
28
|
-
super();
|
|
29
|
-
this.pdfOptions = pdfOptions;
|
|
30
|
-
}
|
|
31
|
-
__checkInstance__(creationOptions) {
|
|
32
|
-
return JSON.stringify(this.pdfOptions) === JSON.stringify(creationOptions);
|
|
33
|
-
}
|
|
34
|
-
async renderToFile(template, model, filePath, language) {
|
|
35
|
-
let server = null;
|
|
36
|
-
let browser = null;
|
|
37
|
-
try {
|
|
38
|
-
this.Log.timeStart(`pdf-template-rendering-${filePath}`);
|
|
39
|
-
this.Log.trace(`Rendering pdf template ${template} to file ${filePath}`);
|
|
40
|
-
const templateBasePath = dirname(template);
|
|
41
|
-
const compiledTemplate = await this.TemplatingService.render(join(templateBasePath, basename(template, '.pdf')) + '.pug', model, language);
|
|
42
|
-
// fire up local http server for serving images etc
|
|
43
|
-
// becouse chromium prevents from reading local files when not
|
|
44
|
-
// rendering file with file:// protocol for security reasons
|
|
45
|
-
server = await this.runLocalServer(templateBasePath);
|
|
46
|
-
browser = await puppeteer.launch(this.Options.args);
|
|
47
|
-
const page = await browser.newPage();
|
|
48
|
-
page
|
|
49
|
-
.on('console', (message) => this.Log.trace(`${message.type().substr(0, 3).toUpperCase()} ${message.text()}`))
|
|
50
|
-
.on('pageerror', ({ message }) => this.Log.error(message))
|
|
51
|
-
.on('response', (response) => this.Log.trace(`${response.status()} ${response.url()}`))
|
|
52
|
-
.on('requestfailed', (request) => this.Log.error(`${request.failure().errorText} ${request.url()}`));
|
|
53
|
-
await page.setBypassCSP(true);
|
|
54
|
-
await page.setContent(compiledTemplate);
|
|
55
|
-
await page.pdf({
|
|
56
|
-
path: filePath,
|
|
57
|
-
...this.pdfOptions,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
this.Log.error(err, `Error rendering pdf template ${template} to file ${filePath}`);
|
|
62
|
-
throw err;
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
const duration = this.Log.timeEnd(`pdf-template-rendering-${filePath}`);
|
|
66
|
-
this.Log.trace(`Ended rendering pdf template ${template} to file ${filePath}, took: ${duration}ms`);
|
|
67
|
-
if (duration > this.Options.renderDurationWarning) {
|
|
68
|
-
this.Log.warn(`Rendering pdf template ${template} to file ${filePath} took too long.`);
|
|
69
|
-
}
|
|
70
|
-
if (browser) {
|
|
71
|
-
await browser.close();
|
|
72
|
-
}
|
|
73
|
-
if (server) {
|
|
74
|
-
await server.close();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
async render(_templateName, _model, _language) {
|
|
79
|
-
throw new NotSupported('cannot render pdf template to string');
|
|
80
|
-
}
|
|
81
|
-
// no compilation at start
|
|
82
|
-
async compile(_path) { }
|
|
83
|
-
async runLocalServer(basePath) {
|
|
84
|
-
const self = this;
|
|
85
|
-
const app = Express();
|
|
86
|
-
app.use(cors());
|
|
87
|
-
app.use(Express.static(basePath));
|
|
88
|
-
return new Promise((resolve, reject) => {
|
|
89
|
-
app
|
|
90
|
-
.listen(this.Options.static.port, function () {
|
|
91
|
-
self.Log.trace(`PDF image server started`);
|
|
92
|
-
self.Log.trace(`PDF static file dir at ${basePath}`);
|
|
93
|
-
resolve(this);
|
|
94
|
-
})
|
|
95
|
-
.on('error', (err) => {
|
|
96
|
-
self.Log.error(err, `PDF image server cannot start`);
|
|
97
|
-
reject(err);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
__decorate([
|
|
103
|
-
Config('templates.pdf'),
|
|
104
|
-
__metadata("design:type", Object)
|
|
105
|
-
], PdfRenderer.prototype, "Options", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
Logger('pdf-templates'),
|
|
108
|
-
__metadata("design:type", Log)
|
|
109
|
-
], PdfRenderer.prototype, "Log", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
LazyInject(),
|
|
112
|
-
__metadata("design:type", Templates)
|
|
113
|
-
], PdfRenderer.prototype, "TemplatingService", void 0);
|
|
114
|
-
PdfRenderer = __decorate([
|
|
115
|
-
Injectable(TemplateRenderer),
|
|
116
|
-
PerInstanceCheck(),
|
|
117
|
-
__metadata("design:paramtypes", [Object])
|
|
118
|
-
], PdfRenderer);
|
|
119
|
-
export { PdfRenderer };
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { default as puppeteer } from 'puppeteer';
|
|
11
|
+
import { NotSupported } from '@spinajs/exceptions';
|
|
12
|
+
import { TemplateRenderer, Templates } from '@spinajs/templates';
|
|
13
|
+
import { Config } from '@spinajs/configuration';
|
|
14
|
+
import { Injectable, LazyInject, PerInstanceCheck } from '@spinajs/di';
|
|
15
|
+
import { basename, dirname, join } from 'path';
|
|
16
|
+
import { Log, Logger } from '@spinajs/log';
|
|
17
|
+
import Express from 'express';
|
|
18
|
+
import cors from 'cors';
|
|
19
|
+
import '@spinajs/templates-pug';
|
|
20
|
+
let PdfRenderer = class PdfRenderer extends TemplateRenderer {
|
|
21
|
+
get Type() {
|
|
22
|
+
return 'pdf';
|
|
23
|
+
}
|
|
24
|
+
get Extension() {
|
|
25
|
+
return '.pdf';
|
|
26
|
+
}
|
|
27
|
+
constructor(pdfOptions) {
|
|
28
|
+
super();
|
|
29
|
+
this.pdfOptions = pdfOptions;
|
|
30
|
+
}
|
|
31
|
+
__checkInstance__(creationOptions) {
|
|
32
|
+
return JSON.stringify(this.pdfOptions) === JSON.stringify(creationOptions);
|
|
33
|
+
}
|
|
34
|
+
async renderToFile(template, model, filePath, language) {
|
|
35
|
+
let server = null;
|
|
36
|
+
let browser = null;
|
|
37
|
+
try {
|
|
38
|
+
this.Log.timeStart(`pdf-template-rendering-${filePath}`);
|
|
39
|
+
this.Log.trace(`Rendering pdf template ${template} to file ${filePath}`);
|
|
40
|
+
const templateBasePath = dirname(template);
|
|
41
|
+
const compiledTemplate = await this.TemplatingService.render(join(templateBasePath, basename(template, '.pdf')) + '.pug', model, language);
|
|
42
|
+
// fire up local http server for serving images etc
|
|
43
|
+
// becouse chromium prevents from reading local files when not
|
|
44
|
+
// rendering file with file:// protocol for security reasons
|
|
45
|
+
server = await this.runLocalServer(templateBasePath);
|
|
46
|
+
browser = await puppeteer.launch(this.Options.args);
|
|
47
|
+
const page = await browser.newPage();
|
|
48
|
+
page
|
|
49
|
+
.on('console', (message) => this.Log.trace(`${message.type().substr(0, 3).toUpperCase()} ${message.text()}`))
|
|
50
|
+
.on('pageerror', ({ message }) => this.Log.error(message))
|
|
51
|
+
.on('response', (response) => this.Log.trace(`${response.status()} ${response.url()}`))
|
|
52
|
+
.on('requestfailed', (request) => this.Log.error(`${request.failure().errorText} ${request.url()}`));
|
|
53
|
+
await page.setBypassCSP(true);
|
|
54
|
+
await page.setContent(compiledTemplate);
|
|
55
|
+
await page.pdf({
|
|
56
|
+
path: filePath,
|
|
57
|
+
...this.pdfOptions,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
this.Log.error(err, `Error rendering pdf template ${template} to file ${filePath}`);
|
|
62
|
+
throw err;
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
const duration = this.Log.timeEnd(`pdf-template-rendering-${filePath}`);
|
|
66
|
+
this.Log.trace(`Ended rendering pdf template ${template} to file ${filePath}, took: ${duration}ms`);
|
|
67
|
+
if (duration > this.Options.renderDurationWarning) {
|
|
68
|
+
this.Log.warn(`Rendering pdf template ${template} to file ${filePath} took too long.`);
|
|
69
|
+
}
|
|
70
|
+
if (browser) {
|
|
71
|
+
await browser.close();
|
|
72
|
+
}
|
|
73
|
+
if (server) {
|
|
74
|
+
await server.close();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async render(_templateName, _model, _language) {
|
|
79
|
+
throw new NotSupported('cannot render pdf template to string');
|
|
80
|
+
}
|
|
81
|
+
// no compilation at start
|
|
82
|
+
async compile(_path) { }
|
|
83
|
+
async runLocalServer(basePath) {
|
|
84
|
+
const self = this;
|
|
85
|
+
const app = Express();
|
|
86
|
+
app.use(cors());
|
|
87
|
+
app.use(Express.static(basePath));
|
|
88
|
+
return new Promise((resolve, reject) => {
|
|
89
|
+
app
|
|
90
|
+
.listen(this.Options.static.port, function () {
|
|
91
|
+
self.Log.trace(`PDF image server started`);
|
|
92
|
+
self.Log.trace(`PDF static file dir at ${basePath}`);
|
|
93
|
+
resolve(this);
|
|
94
|
+
})
|
|
95
|
+
.on('error', (err) => {
|
|
96
|
+
self.Log.error(err, `PDF image server cannot start`);
|
|
97
|
+
reject(err);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
__decorate([
|
|
103
|
+
Config('templates.pdf'),
|
|
104
|
+
__metadata("design:type", Object)
|
|
105
|
+
], PdfRenderer.prototype, "Options", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
Logger('pdf-templates'),
|
|
108
|
+
__metadata("design:type", Log)
|
|
109
|
+
], PdfRenderer.prototype, "Log", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
LazyInject(),
|
|
112
|
+
__metadata("design:type", Templates)
|
|
113
|
+
], PdfRenderer.prototype, "TemplatingService", void 0);
|
|
114
|
+
PdfRenderer = __decorate([
|
|
115
|
+
Injectable(TemplateRenderer),
|
|
116
|
+
PerInstanceCheck(),
|
|
117
|
+
__metadata("design:paramtypes", [Object])
|
|
118
|
+
], PdfRenderer);
|
|
119
|
+
export { PdfRenderer };
|
|
120
120
|
//# sourceMappingURL=index.js.map
|
package/lib/mjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAuB,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAkB,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,wBAAwB,CAAC;AAIzB,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,gBAAgB;IAa/C,IAAW,IAAI;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IA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