Merge branch 'main' into staging
This commit is contained in:
@@ -683,7 +683,7 @@
|
|||||||
{aufnahme.aussenwand_min_12cm_gedaemmt ? "Außenwand min. 12cm gedämmt" : ""}
|
{aufnahme.aussenwand_min_12cm_gedaemmt ? "Außenwand min. 12cm gedämmt" : ""}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xs space-y-1 p-2">
|
<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}
|
{#if ausweis.pruefpunkt_heizungsalter}
|
||||||
<div>Das Heizungsalter ist jünger als 3 Jahre. Es betrifft einen Heizungstausch ohne energetische Verbesserung.</div>
|
<div>Das Heizungsalter ist jünger als 3 Jahre. Es betrifft einen Heizungstausch ohne energetische Verbesserung.</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -199,19 +199,28 @@ export async function pdfVerbrauchsausweisGewerbe(ausweis: VerbrauchsausweisGewe
|
|||||||
|
|
||||||
if (bild) {
|
if (bild) {
|
||||||
const file = await getS3File("ibc-images", `${bild.id}.jpg`);
|
const file = await getS3File("ibc-images", `${bild.id}.jpg`);
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
let image: PDFImage;
|
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, {
|
pages[0].drawImage(image, {
|
||||||
x: 460.5,
|
x: 460.5,
|
||||||
y: height - 289,
|
y: (height - 289 - scaledHeight) + 138, // Adjust y to align the image properly
|
||||||
width: 111,
|
width: scaledWidth,
|
||||||
height: 138
|
height: scaledHeight
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checkmark Verbrauchsausweis.
|
// Checkmark Verbrauchsausweis.
|
||||||
pages[0].drawText("x", {
|
pages[0].drawText("x", {
|
||||||
x: 41,
|
x: 41,
|
||||||
|
|||||||
@@ -59,13 +59,23 @@ export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohne
|
|||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
let image: PDFImage;
|
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, {
|
pages[0].drawImage(image, {
|
||||||
x: 460.5,
|
x: 460.5,
|
||||||
y: height - 289,
|
y: (height - 289 - scaledHeight) + 138, // Adjust y to align the image properly
|
||||||
width: 111,
|
width: scaledWidth,
|
||||||
height: 138
|
height: scaledHeight
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user