@measurequick/measurequick-report-generator 1.2.73 → 1.2.75
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
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PDFDocument } from 'pdf-lib';
|
|
2
2
|
import * as base64 from '../base-64/icons.js';
|
|
3
3
|
import * as pdf from '../base-64/mq-vitals-cooling.js';
|
|
4
|
+
import * as systemInfoPage from './system-info-page.js';
|
|
4
5
|
import * as util from '../util.js';
|
|
5
6
|
|
|
6
7
|
export async function getReport(payload, _test) { console.log("Vitals Cooling - Payload:"); console.log(payload);
|
|
@@ -195,6 +196,13 @@ export async function getReport(payload, _test) { console.log("Vitals Cooling -
|
|
|
195
196
|
}
|
|
196
197
|
} else form.getTextField(`SSR1`).setText("Not yet reviewed");
|
|
197
198
|
|
|
199
|
+
if (payload.meta.report_type != "FullReport") {
|
|
200
|
+
let systemInfoPageBase64 = await systemInfoPage.getReport(payload);
|
|
201
|
+
const systemInfoPageDoc = systemInfoPageBase64 ? await PDFDocument.load(util._base64ToArrayBuffer(systemInfoPageBase64)) : false;
|
|
202
|
+
const [_systemInfoPageDoc] = systemInfoPageDoc ? await pdfDoc.copyPages(systemInfoPageDoc, [0]) : false;
|
|
203
|
+
if (_systemInfoPageDoc) pdfDoc.insertPage(pdfDoc.getPages().length, _systemInfoPageDoc);
|
|
204
|
+
}
|
|
205
|
+
|
|
198
206
|
// flatten and return as base64
|
|
199
207
|
form.flatten();
|
|
200
208
|
const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PDFDocument } from 'pdf-lib';
|
|
2
2
|
import * as base64 from '../base-64/icons.js';
|
|
3
3
|
import * as pdf from '../base-64/mq-vitals-heating.js';
|
|
4
|
+
import * as systemInfoPage from './system-info-page.js';
|
|
4
5
|
import * as util from '../util.js';
|
|
5
6
|
|
|
6
7
|
export async function getReport(payload, _test) { console.log("Vitals Heating - Payload:"); console.log(payload);
|
|
@@ -193,6 +194,13 @@ export async function getReport(payload, _test) { console.log("Vitals Heating -
|
|
|
193
194
|
}
|
|
194
195
|
} else form.getTextField(`SSR1`).setText("Not yet reviewed");
|
|
195
196
|
|
|
197
|
+
if (payload.meta.report_type != "FullReport") {
|
|
198
|
+
let systemInfoPageBase64 = await systemInfoPage.getReport(payload);
|
|
199
|
+
const systemInfoPageDoc = systemInfoPageBase64 ? await PDFDocument.load(util._base64ToArrayBuffer(systemInfoPageBase64)) : false;
|
|
200
|
+
const [_systemInfoPageDoc] = systemInfoPageDoc ? await pdfDoc.copyPages(systemInfoPageDoc, [0]) : false;
|
|
201
|
+
if (_systemInfoPageDoc) pdfDoc.insertPage(pdfDoc.getPages().length, _systemInfoPageDoc);
|
|
202
|
+
}
|
|
203
|
+
|
|
196
204
|
// flatten and return as base64
|
|
197
205
|
form.flatten();
|
|
198
206
|
const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|