@measurequick/measurequick-report-generator 1.0.42 → 1.0.44
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/index.js +13 -17
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export function getReport(data=null) {
|
|
|
24
24
|
companyLogo = reportData.meta.companyLogoPlacement == "footer" ? reportData.photos.companyLogo : null;
|
|
25
25
|
printFooterData(reportData.meta.techName, profilePicture, companyLogo);
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
printPhotoSections();
|
|
28
28
|
|
|
29
29
|
printInfoPage(reportData.meta.reportType);
|
|
30
30
|
|
|
@@ -182,26 +182,22 @@ function printFooterData(techName, profilePicture, companyLogo) {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
function
|
|
185
|
+
function printPhotoSections(photoSections) {
|
|
186
|
+
printSinglePhotoSection("project");
|
|
187
|
+
printSinglePhotoSection("equipment");
|
|
188
|
+
printSinglePhotoSection("site");
|
|
189
|
+
printSinglePhotoSection("customer");
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function printSinglePhotoSection(photoSection) {
|
|
193
|
+
var photos = reportData.photos.userDocumented[photoSection];
|
|
186
194
|
doc.addPage();
|
|
187
195
|
var x = 1;
|
|
188
196
|
var y = 1;
|
|
189
197
|
var i = 0;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
doc.text("TEST", 2, 2);
|
|
194
|
-
// runs up to this point
|
|
195
|
-
for (let photoSection in photoSections) { // project, equipment, site, customer
|
|
196
|
-
for (let p = 0; p < photoSection.length; p++) { // each image
|
|
197
|
-
doc.addImage(photoSection[p].base64, "PNG", x, y, .5, .5);
|
|
198
|
-
y += 1;
|
|
199
|
-
// i++;
|
|
200
|
-
// if (i == 2) {
|
|
201
|
-
// i = 0;
|
|
202
|
-
// doc.addPage();
|
|
203
|
-
// }
|
|
204
|
-
}
|
|
198
|
+
for (let photoIndex = 0; photoIndex < photoSection.length; photoIndex++) {
|
|
199
|
+
doc.addImage(photoSection[photoIndex].base64, "PNG", x, y, .5, .5);
|
|
200
|
+
y += 1;
|
|
205
201
|
}
|
|
206
202
|
}
|
|
207
203
|
|