@measurequick/measurequick-report-generator 1.1.81 → 1.1.83
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
|
@@ -31,6 +31,17 @@ export async function getReport(payload) { console.log(payload);
|
|
|
31
31
|
const iconThumbprintGreen = await pdfDoc.embedPng(iconThumbprintGreenBytes);
|
|
32
32
|
const iconThumbprintRed = await pdfDoc.embedPng(iconThumbprintRedBytes);
|
|
33
33
|
|
|
34
|
+
// embed company logo and profile picture
|
|
35
|
+
let profileImage, companyImage;
|
|
36
|
+
if (payload.photos.profile_image_base64) {
|
|
37
|
+
if (payload.photos.profile_image_base64.includes("image/jpeg")) profileImage = await pdfDoc.embedJpg(util._base64ToArrayBuffer(payload.photos.profile_image_base64));
|
|
38
|
+
else if (payload.photos.profile_image_base64.includes("image/png")) profileImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(payload.photos.profile_image_base64));
|
|
39
|
+
}
|
|
40
|
+
if (payload.photos.company_logo_base64) {
|
|
41
|
+
if (payload.photos.company_logo_base64.includes("image/jpeg")) companyImage = await pdfDoc.embedJpg(util._base64ToArrayBuffer(payload.photos.company_logo_base64));
|
|
42
|
+
else if (payload.photos.company_logo_base64.includes("image/png")) companyImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(payload.photos.company_logo_base64));
|
|
43
|
+
}
|
|
44
|
+
|
|
34
45
|
// get form for filling
|
|
35
46
|
const form = pdfDoc.getForm();
|
|
36
47
|
|
|
@@ -61,17 +72,10 @@ export async function getReport(payload) { console.log(payload);
|
|
|
61
72
|
// get text fields
|
|
62
73
|
let textFields = getTextFields(payload);
|
|
63
74
|
|
|
64
|
-
// print company logo and profile picture
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
mapImagePg1 = await pdfDocPg1.embedJpg(util._base64ToArrayBuffer(payload.map));
|
|
69
|
-
mapImagePg2 = await pdfDocPg2.embedJpg(util._base64ToArrayBuffer(payload.map));
|
|
70
|
-
} else if (payload.map.includes("image/png")) {
|
|
71
|
-
mapImagePg1 = await pdfDocPg1.embedPng(util._base64ToArrayBuffer(payload.map));
|
|
72
|
-
mapImagePg2 = await pdfDocPg2.embedPng(util._base64ToArrayBuffer(payload.map));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
+
// print company logo and profile picture
|
|
76
|
+
if (profileImage) form.getButton("ProfilePicture").setImage(profileImage);
|
|
77
|
+
if (companyImage) form.getButton("HalfWidthLogo").setImage(companyImage);
|
|
78
|
+
form.getTextField('TechName').setText('David Zucco');
|
|
75
79
|
|
|
76
80
|
// print customer data
|
|
77
81
|
let dateTimePlacement = "Upper";
|
|
@@ -31,6 +31,17 @@ export async function getReport(payload) { console.log("Vitals Heating Report");
|
|
|
31
31
|
const iconThumbprintGreen = await pdfDoc.embedPng(iconThumbprintGreenBytes);
|
|
32
32
|
const iconThumbprintRed = await pdfDoc.embedPng(iconThumbprintRedBytes);
|
|
33
33
|
|
|
34
|
+
// embed company logo and profile picture
|
|
35
|
+
let profileImage, companyImage;
|
|
36
|
+
if (payload.photos.profile_image_base64) {
|
|
37
|
+
if (payload.map.includes("image/jpeg")) profileImage = await pdfDoc.embedJpg(util._base64ToArrayBuffer(payload.photos.profile_image_base64));
|
|
38
|
+
else if (payload.map.includes("image/png")) profileImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(payload.photos.profile_image_base64));
|
|
39
|
+
}
|
|
40
|
+
if (payload.photos.company_logo_base64) {
|
|
41
|
+
if (payload.map.includes("image/jpeg")) companyImage = await pdfDoc.embedJpg(util._base64ToArrayBuffer(payload.photos.company_logo_base64));
|
|
42
|
+
else if (payload.map.includes("image/png")) companyImage = await pdfDoc.embedPng(util._base64ToArrayBuffer(payload.photos.company_logo_base64));
|
|
43
|
+
}
|
|
44
|
+
|
|
34
45
|
// get form for filling
|
|
35
46
|
const form = pdfDoc.getForm();
|
|
36
47
|
|
|
@@ -42,6 +53,11 @@ export async function getReport(payload) { console.log("Vitals Heating Report");
|
|
|
42
53
|
// get text fields
|
|
43
54
|
let textFields = getTextFields(payload);
|
|
44
55
|
|
|
56
|
+
// print company logo and profile picture
|
|
57
|
+
if (profileImage) form.getButton("ProfilePicture").setImage(profileImage);
|
|
58
|
+
if (companyImage) form.getButton("HalfWidthLogo").setImage(companyImage);
|
|
59
|
+
form.getTextField('TechName').setText('David Zucco');
|
|
60
|
+
|
|
45
61
|
// print customer data
|
|
46
62
|
let dateTimePlacement = "Upper";
|
|
47
63
|
let e = "";
|