@measurequick/measurequick-report-generator 1.5.177 → 1.5.179
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 +20 -13
- package/report-gen-scripts/measurement-details.js +18 -12
- package/report-gen-scripts/vitals-cooling-report.js +20 -13
- package/report-gen-scripts/vitals-heating-report-no-combustion.js +20 -13
- package/report-gen-scripts/vitals-heating-report.js +20 -13
package/package.json
CHANGED
|
@@ -56,19 +56,26 @@ export async function getReport(payload) {
|
|
|
56
56
|
if (isNCI) {
|
|
57
57
|
const nciLogoImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(base64.nciLogo));
|
|
58
58
|
const pages = pdfDoc.getPages();
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
// Get the ProfilePicture button widgets (may be on multiple pages)
|
|
60
|
+
const profilePictureButton = form.getButton("ProfilePicture");
|
|
61
|
+
const widgets = profilePictureButton.acroField.getWidgets();
|
|
62
|
+
// Draw NCI logo on each page that has the ProfilePicture widget
|
|
63
|
+
for (let i = 0; i < widgets.length; i++) {
|
|
64
|
+
const rect = widgets[i].getRectangle();
|
|
65
|
+
const page = pages[i] || pages[0];
|
|
66
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
67
|
+
const logoWidth = rect.width * 1.15;
|
|
68
|
+
const logoHeight = logoWidth * (nciLogoImage.height / nciLogoImage.width);
|
|
69
|
+
// Center the logo in the original field area
|
|
70
|
+
const x = rect.x + (rect.width - logoWidth) / 2;
|
|
71
|
+
const y = rect.y + (rect.height - logoHeight) / 2;
|
|
72
|
+
page.drawImage(nciLogoImage, {
|
|
73
|
+
x: x,
|
|
74
|
+
y: y,
|
|
75
|
+
width: logoWidth,
|
|
76
|
+
height: logoHeight,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
72
79
|
// Still set company logo
|
|
73
80
|
if (companyImage) {
|
|
74
81
|
form.getButton("HalfWidthLogo").setImage(companyImage);
|
|
@@ -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
|
|
@@ -132,19 +132,26 @@ export async function getReport(payload, _test) {
|
|
|
132
132
|
if (isNCI) {
|
|
133
133
|
const nciLogoImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(base64.nciLogo));
|
|
134
134
|
const pages = pdfDoc.getPages();
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
// Get the ProfilePicture button widgets (may be on multiple pages)
|
|
136
|
+
const profilePictureButton = form.getButton("ProfilePicture");
|
|
137
|
+
const widgets = profilePictureButton.acroField.getWidgets();
|
|
138
|
+
// Draw NCI logo on each page that has the ProfilePicture widget
|
|
139
|
+
for (let i = 0; i < widgets.length; i++) {
|
|
140
|
+
const rect = widgets[i].getRectangle();
|
|
141
|
+
const page = pages[i] || pages[0];
|
|
142
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
143
|
+
const logoWidth = rect.width * 1.15;
|
|
144
|
+
const logoHeight = logoWidth * (nciLogoImage.height / nciLogoImage.width);
|
|
145
|
+
// Center the logo in the original field area
|
|
146
|
+
const x = rect.x + (rect.width - logoWidth) / 2;
|
|
147
|
+
const y = rect.y + (rect.height - logoHeight) / 2;
|
|
148
|
+
page.drawImage(nciLogoImage, {
|
|
149
|
+
x: x,
|
|
150
|
+
y: y,
|
|
151
|
+
width: logoWidth,
|
|
152
|
+
height: logoHeight,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
148
155
|
// Still set company logo
|
|
149
156
|
if (companyImage) {
|
|
150
157
|
form.getButton("HalfWidthLogo").setImage(companyImage);
|
|
@@ -120,19 +120,26 @@ export async function getReport(payload, _test) {
|
|
|
120
120
|
if (isNCI) {
|
|
121
121
|
const nciLogoImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(base64.nciLogo));
|
|
122
122
|
const pages = pdfDoc.getPages();
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
123
|
+
// Get the ProfilePicture button widgets (may be on multiple pages)
|
|
124
|
+
const profilePictureButton = form.getButton("ProfilePicture");
|
|
125
|
+
const widgets = profilePictureButton.acroField.getWidgets();
|
|
126
|
+
// Draw NCI logo on each page that has the ProfilePicture widget
|
|
127
|
+
for (let i = 0; i < widgets.length; i++) {
|
|
128
|
+
const rect = widgets[i].getRectangle();
|
|
129
|
+
const page = pages[i] || pages[0];
|
|
130
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
131
|
+
const logoWidth = rect.width * 1.15;
|
|
132
|
+
const logoHeight = logoWidth * (nciLogoImage.height / nciLogoImage.width);
|
|
133
|
+
// Center the logo in the original field area
|
|
134
|
+
const x = rect.x + (rect.width - logoWidth) / 2;
|
|
135
|
+
const y = rect.y + (rect.height - logoHeight) / 2;
|
|
136
|
+
page.drawImage(nciLogoImage, {
|
|
137
|
+
x: x,
|
|
138
|
+
y: y,
|
|
139
|
+
width: logoWidth,
|
|
140
|
+
height: logoHeight,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
136
143
|
// Still set company logo
|
|
137
144
|
if (companyImage) {
|
|
138
145
|
safeSetImage(form, "HalfWidthLogo", companyImage);
|
|
@@ -133,19 +133,26 @@ export async function getReport(payload, _test) {
|
|
|
133
133
|
if (isNCI) {
|
|
134
134
|
const nciLogoImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(base64.nciLogo));
|
|
135
135
|
const pages = pdfDoc.getPages();
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
136
|
+
// Get the ProfilePicture button widgets (may be on multiple pages)
|
|
137
|
+
const profilePictureButton = form.getButton("ProfilePicture");
|
|
138
|
+
const widgets = profilePictureButton.acroField.getWidgets();
|
|
139
|
+
// Draw NCI logo on each page that has the ProfilePicture widget
|
|
140
|
+
for (let i = 0; i < widgets.length; i++) {
|
|
141
|
+
const rect = widgets[i].getRectangle();
|
|
142
|
+
const page = pages[i] || pages[0];
|
|
143
|
+
// Draw NCI logo at the profile picture position, 15% larger
|
|
144
|
+
const logoWidth = rect.width * 1.15;
|
|
145
|
+
const logoHeight = logoWidth * (nciLogoImage.height / nciLogoImage.width);
|
|
146
|
+
// Center the logo in the original field area
|
|
147
|
+
const x = rect.x + (rect.width - logoWidth) / 2;
|
|
148
|
+
const y = rect.y + (rect.height - logoHeight) / 2;
|
|
149
|
+
page.drawImage(nciLogoImage, {
|
|
150
|
+
x: x,
|
|
151
|
+
y: y,
|
|
152
|
+
width: logoWidth,
|
|
153
|
+
height: logoHeight,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
149
156
|
// Still set company logo
|
|
150
157
|
if (companyImage) {
|
|
151
158
|
safeSetImage(form, "HalfWidthLogo", companyImage);
|