@ejfdelgado/ejflab-back 1.31.1 → 1.31.2
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/package.json +1 -1
- package/srv/MyPdf.mjs +9 -1
package/package.json
CHANGED
package/srv/MyPdf.mjs
CHANGED
@@ -7,6 +7,14 @@ import { MyUtilities } from '@ejfdelgado/ejflab-common/src/MyUtilities.js';
|
|
7
7
|
import MyDatesBack from '@ejfdelgado/ejflab-common/src/MyDatesBack.mjs';
|
8
8
|
import { TranslateSrv } from "./TranslateSrv.mjs";
|
9
9
|
|
10
|
+
let executablePath = '/usr/bin/google-chrome';
|
11
|
+
if (process.platform === 'win32') {
|
12
|
+
executablePath = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe';
|
13
|
+
}
|
14
|
+
if (process.env.CHROME_PATH) {
|
15
|
+
executablePath = process.env.CHROME_PATH;
|
16
|
+
}
|
17
|
+
|
10
18
|
export class MyPdf {
|
11
19
|
static async localRender(template, model = {}, format = "pdf", extra = [], configuration, launch) {
|
12
20
|
const source = fs.readFileSync(`./src/assets/templates/pdf/${template}`, { encoding: "utf8" });
|
@@ -60,7 +68,7 @@ export class MyPdf {
|
|
60
68
|
if (!launch) {
|
61
69
|
launch = {
|
62
70
|
headless: 'new',
|
63
|
-
executablePath:
|
71
|
+
executablePath: executablePath,
|
64
72
|
args: [
|
65
73
|
"--no-sandbox",
|
66
74
|
"--disable-gpu",
|