@measurequick/measurequick-report-generator 1.5.177 → 1.5.178
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/report-gen-scripts/corrective-measures.js +9 -5
- package/report-gen-scripts/measurement-details.js +18 -12
- package/report-gen-scripts/vitals-cooling-report.js +9 -5
- package/report-gen-scripts/vitals-heating-report-no-combustion.js +9 -5
- package/report-gen-scripts/vitals-heating-report.js +9 -5
package/package.json
CHANGED
|
@@ -57,12 +57,16 @@ export async function getReport(payload) {
|
|
|
57
57
|
const nciLogoImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(base64.nciLogo));
|
|
58
58
|
const pages = pdfDoc.getPages();
|
|
59
59
|
const firstPage = pages[0];
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
60
|
+
// Get the ProfilePicture button position from the form field
|
|
61
|
+
const profilePictureButton = form.getButton("ProfilePicture");
|
|
62
|
+
const widgets = profilePictureButton.acroField.getWidgets();
|
|
63
|
+
const rect = widgets[0].getRectangle();
|
|
64
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
65
|
+
const logoWidth = rect.width * 1.15;
|
|
63
66
|
const logoHeight = logoWidth * (nciLogoImage.height / nciLogoImage.width);
|
|
64
|
-
|
|
65
|
-
const
|
|
67
|
+
// Center the logo in the original field area
|
|
68
|
+
const x = rect.x + (rect.width - logoWidth) / 2;
|
|
69
|
+
const y = rect.y + (rect.height - logoHeight) / 2;
|
|
66
70
|
firstPage.drawImage(nciLogoImage, {
|
|
67
71
|
x: x,
|
|
68
72
|
y: y,
|
|
@@ -209,26 +209,32 @@ export async function getReport(payload) {
|
|
|
209
209
|
const pagesPg2 = pdfDocPg2.getPages();
|
|
210
210
|
const firstPagePg1 = pagesPg1[0];
|
|
211
211
|
const firstPagePg2 = pagesPg2[0];
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
-
const
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
const
|
|
212
|
+
// Get the ProfilePicture button position from form fields
|
|
213
|
+
const profilePictureButtonPg1 = formPg1.getButton("ProfilePicture");
|
|
214
|
+
const widgetsPg1 = profilePictureButtonPg1.acroField.getWidgets();
|
|
215
|
+
const rectPg1 = widgetsPg1[0].getRectangle();
|
|
216
|
+
const profilePictureButtonPg2 = formPg2.getButton("ProfilePicture");
|
|
217
|
+
const widgetsPg2 = profilePictureButtonPg2.acroField.getWidgets();
|
|
218
|
+
const rectPg2 = widgetsPg2[0].getRectangle();
|
|
219
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
220
|
+
const logoWidth1 = rectPg1.width * 1.15;
|
|
221
|
+
const logoHeight1 = logoWidth1 * (nciLogoImagePg1.height / nciLogoImagePg1.width);
|
|
222
|
+
const x1 = rectPg1.x + (rectPg1.width - logoWidth1) / 2;
|
|
223
|
+
const y1 = rectPg1.y + (rectPg1.height - logoHeight1) / 2;
|
|
224
|
+
const logoWidth2 = rectPg2.width * 1.15;
|
|
225
|
+
const logoHeight2 = logoWidth2 * (nciLogoImagePg2.height / nciLogoImagePg2.width);
|
|
226
|
+
const x2 = rectPg2.x + (rectPg2.width - logoWidth2) / 2;
|
|
227
|
+
const y2 = rectPg2.y + (rectPg2.height - logoHeight2) / 2;
|
|
222
228
|
firstPagePg1.drawImage(nciLogoImagePg1, {
|
|
223
229
|
x: x1,
|
|
224
230
|
y: y1,
|
|
225
|
-
width:
|
|
231
|
+
width: logoWidth1,
|
|
226
232
|
height: logoHeight1,
|
|
227
233
|
});
|
|
228
234
|
firstPagePg2.drawImage(nciLogoImagePg2, {
|
|
229
235
|
x: x2,
|
|
230
236
|
y: y2,
|
|
231
|
-
width:
|
|
237
|
+
width: logoWidth2,
|
|
232
238
|
height: logoHeight2,
|
|
233
239
|
});
|
|
234
240
|
// Still set company logo
|
|
@@ -133,12 +133,16 @@ export async function getReport(payload, _test) {
|
|
|
133
133
|
const nciLogoImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(base64.nciLogo));
|
|
134
134
|
const pages = pdfDoc.getPages();
|
|
135
135
|
const firstPage = pages[0];
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const
|
|
136
|
+
// Get the ProfilePicture button position from the form field
|
|
137
|
+
const profilePictureButton = form.getButton("ProfilePicture");
|
|
138
|
+
const widgets = profilePictureButton.acroField.getWidgets();
|
|
139
|
+
const rect = widgets[0].getRectangle();
|
|
140
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
141
|
+
const logoWidth = rect.width * 1.15;
|
|
139
142
|
const logoHeight = logoWidth * (nciLogoImage.height / nciLogoImage.width);
|
|
140
|
-
|
|
141
|
-
const
|
|
143
|
+
// Center the logo in the original field area
|
|
144
|
+
const x = rect.x + (rect.width - logoWidth) / 2;
|
|
145
|
+
const y = rect.y + (rect.height - logoHeight) / 2;
|
|
142
146
|
firstPage.drawImage(nciLogoImage, {
|
|
143
147
|
x: x,
|
|
144
148
|
y: y,
|
|
@@ -121,12 +121,16 @@ export async function getReport(payload, _test) {
|
|
|
121
121
|
const nciLogoImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(base64.nciLogo));
|
|
122
122
|
const pages = pdfDoc.getPages();
|
|
123
123
|
const firstPage = pages[0];
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const
|
|
124
|
+
// Get the ProfilePicture button position from the form field
|
|
125
|
+
const profilePictureButton = form.getButton("ProfilePicture");
|
|
126
|
+
const widgets = profilePictureButton.acroField.getWidgets();
|
|
127
|
+
const rect = widgets[0].getRectangle();
|
|
128
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
129
|
+
const logoWidth = rect.width * 1.15;
|
|
127
130
|
const logoHeight = logoWidth * (nciLogoImage.height / nciLogoImage.width);
|
|
128
|
-
|
|
129
|
-
const
|
|
131
|
+
// Center the logo in the original field area
|
|
132
|
+
const x = rect.x + (rect.width - logoWidth) / 2;
|
|
133
|
+
const y = rect.y + (rect.height - logoHeight) / 2;
|
|
130
134
|
firstPage.drawImage(nciLogoImage, {
|
|
131
135
|
x: x,
|
|
132
136
|
y: y,
|
|
@@ -134,12 +134,16 @@ export async function getReport(payload, _test) {
|
|
|
134
134
|
const nciLogoImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(base64.nciLogo));
|
|
135
135
|
const pages = pdfDoc.getPages();
|
|
136
136
|
const firstPage = pages[0];
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const
|
|
137
|
+
// Get the ProfilePicture button position from the form field
|
|
138
|
+
const profilePictureButton = form.getButton("ProfilePicture");
|
|
139
|
+
const widgets = profilePictureButton.acroField.getWidgets();
|
|
140
|
+
const rect = widgets[0].getRectangle();
|
|
141
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
142
|
+
const logoWidth = rect.width * 1.15;
|
|
140
143
|
const logoHeight = logoWidth * (nciLogoImage.height / nciLogoImage.width);
|
|
141
|
-
|
|
142
|
-
const
|
|
144
|
+
// Center the logo in the original field area
|
|
145
|
+
const x = rect.x + (rect.width - logoWidth) / 2;
|
|
146
|
+
const y = rect.y + (rect.height - logoHeight) / 2;
|
|
143
147
|
firstPage.drawImage(nciLogoImage, {
|
|
144
148
|
x: x,
|
|
145
149
|
y: y,
|