Skip to content

Commit

Permalink
feature(pdf-service): remove Druckvermerk from Hinweisblatt in pkh pdf (
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrtrfl authored Dec 5, 2024
1 parent 3e3d6b5 commit 860d1f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
9 changes: 2 additions & 7 deletions app/domains/prozesskostenhilfe/services/pdf/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ export async function prozesskostenhilfePdfFromUserdata(
],
});

const xPositionDruckvermerk = 9;

const filledPdfFormDocument = await fillPdf({
flowId: "/prozesskostenhilfe/formular",
pdfValues,
yPositionsDruckvermerk: [43, 51, 40, 44], // Different y positions because the form boxes jump for each page
xPositionsDruckvermerk: xPositionDruckvermerk,
xPositionsDruckvermerk: 9,
});

printNameInSignatureFormField(filledPdfFormDocument, userData);
Expand All @@ -116,10 +114,7 @@ export async function prozesskostenhilfePdfFromUserdata(

await appendPagesToPdf(
filledPdfFormDocumentWithMetadata,
await loadHinweisblatt({
yPositionDruckvermerk: 44,
xPositionDruckvermerk,
}),
await loadHinweisblatt(),
);

return filledPdfFormDocumentWithMetadata.save();
Expand Down
11 changes: 1 addition & 10 deletions app/domains/prozesskostenhilfe/services/pdf/loadHinweisblatt.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import fs from "node:fs";
import path from "node:path";
import { PDFDocument } from "pdf-lib";
import { addDruckvermerk } from "~/services/pdf/druckvermerk";

export default async function loadHinweisblatt({
yPositionDruckvermerk,
xPositionDruckvermerk,
}: {
yPositionDruckvermerk: number;
xPositionDruckvermerk: number;
}) {
export default async function loadHinweisblatt() {
const filepath = path.resolve(
path.join(
process.cwd(),
Expand All @@ -21,7 +14,5 @@ export default async function loadHinweisblatt({

const pdfDoc = await PDFDocument.load(fs.readFileSync(filepath));

addDruckvermerk(pdfDoc, yPositionDruckvermerk, xPositionDruckvermerk);

return pdfDoc;
}

0 comments on commit 860d1f3

Please sign in to comment.