Persistent Directory

This commit is contained in:
Moritz Utcke
2025-02-22 12:37:54 +11:00
parent 6cf8910839
commit 69e169362b
15 changed files with 36 additions and 24 deletions

View File

@@ -8,6 +8,7 @@ import { Heizungsstatus } from "#lib/server/prisma.js";
import { endEnergieVerbrauchVerbrauchsausweisGewerbe_2016 } from "#lib/Berechnungen/VerbrauchsausweisGewerbe/VerbrauchsausweisGewerbe_2016.js";
import { fileURLToPath } from "url";
import { copyPage } from "./utils/copyPage.js";
import { PERSISTENT_DIR } from "#lib/server/constants.js";
/* -------------------------------- Pdf Tools ------------------------------- */
@@ -359,7 +360,7 @@ export async function pdfDatenblattVerbrauchsausweisGewerbe(ausweis: Verbrauchsa
let image: string = "";
if (bild.uid) {
image = `<img src="${fileURLToPath(new URL(`../../../../persistent/images/${bilder[0].uid}.jpg`, import.meta.url))}" width="${(pages[2].getHeight() - 120) / 3.1}" />`
image = `<img src="${fileURLToPath(new URL(`${PERSISTENT_DIR}/images/${bilder[0].uid}.jpg`, import.meta.url))}" width="${(pages[2].getHeight() - 120) / 3.1}" />`
} else if (bild.data) {
image = `<img data="${bild.data}" width="${(pages[2].getWidth() - 120) / 3.1}" height="180" />`
}