@measurequick/measurequick-report-generator 1.2.73 → 1.2.74

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,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.2.73",
3
+ "version": "1.2.74",
4
4
  "description": "Generates PDF documents for various MeasureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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,11 @@ 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
+ let systemInfoPageBase64 = await systemInfoPage.getReport(payload);
200
+ const systemInfoPageDoc = systemInfoPageBase64 ? await PDFDocument.load(util._base64ToArrayBuffer(systemInfoPageBase64)) : false;
201
+ const [_systemInfoPageDoc] = systemInfoPageDoc ? await pdfDoc.copyPages(systemInfoPageDoc, [0]) : false;
202
+ if (_systemInfoPageDoc) pdfDoc.insertPage(pdfDoc.getPages().length, _systemInfoPageDoc);
203
+
198
204
  // flatten and return as base64
199
205
  form.flatten();
200
206
  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,11 @@ 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
+ let systemInfoPageBase64 = await systemInfoPage.getReport(payload);
198
+ const systemInfoPageDoc = systemInfoPageBase64 ? await PDFDocument.load(util._base64ToArrayBuffer(systemInfoPageBase64)) : false;
199
+ const [_systemInfoPageDoc] = systemInfoPageDoc ? await pdfDoc.copyPages(systemInfoPageDoc, [0]) : false;
200
+ if (_systemInfoPageDoc) pdfDoc.insertPage(pdfDoc.getPages().length, _systemInfoPageDoc);
201
+
196
202
  // flatten and return as base64
197
203
  form.flatten();
198
204
  const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });