Auto stash before rebase of "main" onto "origin/main"
This commit is contained in:
@@ -199,19 +199,28 @@ export async function pdfVerbrauchsausweisGewerbe(ausweis: VerbrauchsausweisGewe
|
||||
|
||||
if (bild) {
|
||||
const file = await getS3File("ibc-images", `${bild.id}.jpg`);
|
||||
|
||||
if (file) {
|
||||
let image: PDFImage;
|
||||
image = await pdf.embedJpg(file)
|
||||
image = await pdf.embedJpg(file);
|
||||
|
||||
const originalWidth = image.width;
|
||||
const originalHeight = image.height;
|
||||
|
||||
// Calculate the scaling factor to fit within the maximum dimensions while maintaining proportions
|
||||
const scaleFactor = Math.min(111 / originalWidth, 138 / originalHeight);
|
||||
|
||||
const scaledWidth = originalWidth * scaleFactor;
|
||||
const scaledHeight = originalHeight * scaleFactor;
|
||||
|
||||
pages[0].drawImage(image, {
|
||||
x: 460.5,
|
||||
y: height - 289,
|
||||
width: 111,
|
||||
height: 138
|
||||
})
|
||||
y: (height - 289 - scaledHeight) + 138, // Adjust y to align the image properly
|
||||
width: scaledWidth,
|
||||
height: scaledHeight
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Checkmark Verbrauchsausweis.
|
||||
pages[0].drawText("x", {
|
||||
x: 41,
|
||||
|
||||
@@ -59,13 +59,23 @@ export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohne
|
||||
|
||||
if (file) {
|
||||
let image: PDFImage;
|
||||
image = await pdf.embedJpg(file)
|
||||
image = await pdf.embedJpg(file);
|
||||
|
||||
const originalWidth = image.width;
|
||||
const originalHeight = image.height;
|
||||
|
||||
// Calculate the scaling factor to fit within the maximum dimensions while maintaining proportions
|
||||
const scaleFactor = Math.min(111 / originalWidth, 138 / originalHeight);
|
||||
|
||||
const scaledWidth = originalWidth * scaleFactor;
|
||||
const scaledHeight = originalHeight * scaleFactor;
|
||||
|
||||
pages[0].drawImage(image, {
|
||||
x: 460.5,
|
||||
y: height - 289,
|
||||
width: 111,
|
||||
height: 138
|
||||
})
|
||||
y: (height - 289 - scaledHeight) + 138, // Adjust y to align the image properly
|
||||
width: scaledWidth,
|
||||
height: scaledHeight
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user