Files
online-energieausweis/src/lib/pdf/utils/helpers.ts
Moritz Utcke 0956744878 Ausstellen
2025-04-08 19:34:51 -04:00

34 lines
741 B
TypeScript

import { PDFPage, PDFFont, RotationTypes } from "pdf-lib";
export function addDatumGEG(page: PDFPage, font: PDFFont) {
page.drawText("20. Juli 2022", {
x: 308,
y: page.getHeight() - 70,
size: 10,
font,
});
}
export function addAnsichtsausweisLabel(page: PDFPage, font: PDFFont) {
page.drawText("Ansichtsausweis", {
x: page.getWidth() / 2 - font.heightAtSize(112) * 2.2,
y: page.getHeight() - font.heightAtSize(112) / 2,
size: 112,
font,
rotate: {
type: RotationTypes.Degrees,
angle: -60,
},
opacity: 0.3,
});
}
export function addRegistriernummer(page: PDFPage, font: PDFFont, registriernummer: string) {
page.drawText(registriernummer, {
x: 435,
y: page.getHeight() - 113,
size: 10,
font,
});
}