Merge branch 'staging' into dev
This commit is contained in:
@@ -688,7 +688,7 @@
|
||||
{aufnahme.aussenwand_min_12cm_gedaemmt ? "Außenwand min. 12cm gedämmt" : ""}
|
||||
</div>
|
||||
<div class="text-xs space-y-1 p-2">
|
||||
<span class="font-semibold">Hiermit bestätige ich {benutzer.vorname} {benutzer.name} als Besteller folgende Angaben:</span><br>
|
||||
<span class="font-semibold">Hiermit bestätige ich {benutzer.vorname} {benutzer.name} als Besteller:</span><br>
|
||||
{#if ausweis.pruefpunkt_heizungsalter}
|
||||
<div>Das Heizungsalter ist jünger als 3 Jahre. Es betrifft einen Heizungstausch ohne energetische Verbesserung.</div>
|
||||
{/if}
|
||||
|
||||
@@ -199,16 +199,25 @@ 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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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