This commit is contained in:
BIN
public/pdf/images/aussteller.png
Normal file
BIN
public/pdf/images/aussteller.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 144 KiB |
9
public/pdf/images/aussteller.svg
Normal file
9
public/pdf/images/aussteller.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 39 KiB |
BIN
public/pdf/images/pfeil-nach-oben.png
Normal file
BIN
public/pdf/images/pfeil-nach-oben.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 777 B |
BIN
public/pdf/images/pfeil-nach-unten.png
Normal file
BIN
public/pdf/images/pfeil-nach-unten.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
BIN
public/pdf/images/stempel-unterschrift.png
Normal file
BIN
public/pdf/images/stempel-unterschrift.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 503 KiB |
3
public/pdf/images/verbrauch-pfeil.svg
Normal file
3
public/pdf/images/verbrauch-pfeil.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="165" height="225" viewBox="0 0 165 225" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M123.532 0H40.5V140H0L85.5 225L164.5 140H123.532V0Z" fill="#908580"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 186 B |
BIN
public/pdf/templates/GEG24_Nichtwohngebaeude.pdf
Normal file
BIN
public/pdf/templates/GEG24_Nichtwohngebaeude.pdf
Normal file
Binary file not shown.
1
public/pdf/templates/GEG24_Verbrauchsausweis.json
Normal file
1
public/pdf/templates/GEG24_Verbrauchsausweis.json
Normal file
File diff suppressed because one or more lines are too long
BIN
public/pdf/templates/GEG24_Wohngebaeude.pdf
Normal file
BIN
public/pdf/templates/GEG24_Wohngebaeude.pdf
Normal file
Binary file not shown.
BIN
public/pdf/templates/GEG24_Wohngebaeude_ohne_pfeile.pdf
Normal file
BIN
public/pdf/templates/GEG24_Wohngebaeude_ohne_pfeile.pdf
Normal file
Binary file not shown.
BIN
public/pdf/templates/GEG24_Wohngebaeude_ohne_pfeile_form.pdf
Normal file
BIN
public/pdf/templates/GEG24_Wohngebaeude_ohne_pfeile_form.pdf
Normal file
Binary file not shown.
BIN
public/pdf/templates/Leerseite_Datenblatt.pdf
Normal file
BIN
public/pdf/templates/Leerseite_Datenblatt.pdf
Normal file
Binary file not shown.
0
src/assets/awd.png
Normal file
0
src/assets/awd.png
Normal file
@@ -12,8 +12,8 @@ export const createCaller = createCallerFactory({
|
||||
"admin/post-ausstellen": await import("../src/pages/api/admin/post-ausstellen.ts"),
|
||||
"admin/registriernummer": await import("../src/pages/api/admin/registriernummer.ts"),
|
||||
"admin/stornieren": await import("../src/pages/api/admin/stornieren.ts"),
|
||||
"ausweise": await import("../src/pages/api/ausweise/index.ts"),
|
||||
"aufnahme": await import("../src/pages/api/aufnahme/index.ts"),
|
||||
"ausweise": await import("../src/pages/api/ausweise/index.ts"),
|
||||
"auth/access-token": await import("../src/pages/api/auth/access-token.ts"),
|
||||
"auth/forgot-password": await import("../src/pages/api/auth/forgot-password.ts"),
|
||||
"auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"),
|
||||
@@ -25,11 +25,11 @@ export const createCaller = createCallerFactory({
|
||||
"geg-nachweis-wohnen/[uid]": await import("../src/pages/api/geg-nachweis-wohnen/[uid].ts"),
|
||||
"geg-nachweis-wohnen": await import("../src/pages/api/geg-nachweis-wohnen/index.ts"),
|
||||
"objekt": await import("../src/pages/api/objekt/index.ts"),
|
||||
"user": await import("../src/pages/api/user/index.ts"),
|
||||
"user/self": await import("../src/pages/api/user/self.ts"),
|
||||
"rechnung/anfordern": await import("../src/pages/api/rechnung/anfordern.ts"),
|
||||
"rechnung": await import("../src/pages/api/rechnung/index.ts"),
|
||||
"ticket": await import("../src/pages/api/ticket/index.ts"),
|
||||
"user": await import("../src/pages/api/user/index.ts"),
|
||||
"user/self": await import("../src/pages/api/user/self.ts"),
|
||||
"verbrauchsausweis-gewerbe/[uid]": await import("../src/pages/api/verbrauchsausweis-gewerbe/[uid].ts"),
|
||||
"verbrauchsausweis-gewerbe": await import("../src/pages/api/verbrauchsausweis-gewerbe/index.ts"),
|
||||
"verbrauchsausweis-wohnen/[uid]": await import("../src/pages/api/verbrauchsausweis-wohnen/[uid].ts"),
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import HelpLabel from "#components/labels/HelpLabel.svelte";
|
||||
import Inputlabel from "#components/labels/InputLabel.svelte";
|
||||
import { Enums } from "#lib/client/prisma.js";
|
||||
|
||||
import { Enums } from "@ibcornelsen/database/client";
|
||||
|
||||
export let ausweis;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { PERSISTENT_DIR } from "#lib/server/constants.js";
|
||||
/* -------------------------------- Pdf Tools ------------------------------- */
|
||||
|
||||
export async function pdfDatenblattVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohnenClient, aufnahme: AufnahmeClient, objekt: ObjektClient, benutzer: BenutzerClient, bilder: UploadedGebaeudeBild[]) {
|
||||
const VerbrauchsausweisWohnenGEG2024PDF = fs.readFileSync(new URL("./templates/Leerseite_Datenblatt.pdf", import.meta.url), "base64");
|
||||
const VerbrauchsausweisWohnenGEG2024PDF = fs.readFileSync(new URL("../../../public/pdf/templates/Leerseite_Datenblatt.pdf", import.meta.url), "base64");
|
||||
const pdf = await PDFDocument.load(VerbrauchsausweisWohnenGEG2024PDF)
|
||||
const page3 = copyPage(pdf.getPages()[0]);
|
||||
pdf.addPage(page3);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { AufnahmeClient, BenutzerClient, BildClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
|
||||
import { AufnahmeClient, BenutzerClient, BildClient, ObjektClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
|
||||
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016.js";
|
||||
import { getEmpfehlungen } from "#lib/XML/getEmpfehlungen.js";
|
||||
import { Enums } from "#lib/server/prisma.js";
|
||||
import * as fs from "fs"
|
||||
import moment from "moment";
|
||||
import { PDFDocument, PDFFont, PDFImage, PDFPage, RotationTypes, StandardFonts, TextAlignment } from "pdf-lib";
|
||||
import { PDFDocument, PDFFont, PDFImage, PDFPage, StandardFonts, TextAlignment } from "pdf-lib";
|
||||
import { addCheckMark } from "./utils/checkbox.js";
|
||||
import { addText } from "./utils/text.js";
|
||||
import { addAnsichtsausweisLabel, addDatumGEG } from "./utils/helpers.js";
|
||||
@@ -14,7 +14,7 @@ import { PERSISTENT_DIR } from "#lib/server/constants.js";
|
||||
/* -------------------------------- Pdf Tools ------------------------------- */
|
||||
|
||||
export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohnenClient, aufnahme: AufnahmeClient, objekt: ObjektClient, bilder: BildClient[], user: BenutzerClient) {
|
||||
const VerbrauchsausweisWohnenGEG2024PDF = fs.readFileSync(new URL("./templates/GEG24_Wohngebaeude_ohne_pfeile_form.pdf", import.meta.url), "base64");
|
||||
const VerbrauchsausweisWohnenGEG2024PDF = fs.readFileSync(new URL("../../../public/pdf/templates/GEG24_Wohngebaeude_ohne_pfeile_form.pdf", import.meta.url), "base64");
|
||||
const pdf = await PDFDocument.load(VerbrauchsausweisWohnenGEG2024PDF)
|
||||
const pages = pdf.getPages()
|
||||
|
||||
@@ -130,7 +130,7 @@ export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohne
|
||||
|
||||
// Stempel und Unterschrift
|
||||
if (ausweis.ausgestellt) {
|
||||
const stempel = await pdf.embedPng(fs.readFileSync(new URL("./images/stempel-unterschrift.png", import.meta.url), "base64"));
|
||||
const stempel = await pdf.embedPng(fs.readFileSync(new URL("../../../public/pdf/images/stempel-unterschrift.png", import.meta.url), "base64"));
|
||||
const stempelHeight = 60
|
||||
|
||||
pages[0].drawImage(stempel, {
|
||||
@@ -142,7 +142,7 @@ export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohne
|
||||
}
|
||||
|
||||
// Aussteller
|
||||
const aussteller = await pdf.embedPng(fs.readFileSync(new URL("./images/aussteller.png", import.meta.url), "base64"));
|
||||
const aussteller = await pdf.embedPng(fs.readFileSync(new URL("../../../public/pdf/images/aussteller.png", import.meta.url), "base64"));
|
||||
pages[0].drawImage(aussteller, {
|
||||
x: 40,
|
||||
y: height - 770,
|
||||
@@ -184,8 +184,8 @@ export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohne
|
||||
|
||||
|
||||
const addEnergieverbrauchSkalaPfeile = async (page: PDFPage) => {
|
||||
const pfeilNachUnten = await pdf.embedPng(fs.readFileSync(new URL("./images/pfeil-nach-unten.png", import.meta.url), "base64"))
|
||||
const pfeilNachOben = await pdf.embedPng(fs.readFileSync(new URL("./images/pfeil-nach-oben.png", import.meta.url), "base64"))
|
||||
const pfeilNachUnten = await pdf.embedPng(fs.readFileSync(new URL("../../../public/pdf/images/pfeil-nach-unten.png", import.meta.url), "base64"))
|
||||
const pfeilNachOben = await pdf.embedPng(fs.readFileSync(new URL("../../../public/pdf/images/pfeil-nach-oben.png", import.meta.url), "base64"))
|
||||
|
||||
// Wir müssen den berechneten Wert zwischen 0 und 250 als Wert zwischen 0 und 1 festlegen
|
||||
const endenergieverbrauchTranslationPercentage = Math.min(250, Math.max(0, berechnungen?.endEnergieVerbrauchGesamt || 0)) / 250
|
||||
|
||||
Reference in New Issue
Block a user