Skip to content

Commit

Permalink
fix(ensure fonts are loaded before drawing PDF Druckvermerk)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer6497 committed Dec 31, 2024
1 parent eb3b452 commit 4924f38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/services/pdf/fillPdf.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ export async function fillPdf({

const pdfDoc = await PDFDocument.load(global.__pdfFileBuffers[flowId]!);
resizeToA4(pdfDoc);
addDruckvermerk(pdfDoc, yPositionsDruckvermerk, xPositionsDruckvermerk);

const form = pdfDoc.getForm();

pdfDoc.registerFontkit(fontkit);
customPdfFormFont = await pdfDoc.embedFont(bundesSansCondensed, {
features: {
liga: false,
},
});
addDruckvermerk(pdfDoc, yPositionsDruckvermerk, xPositionsDruckvermerk);

const form = pdfDoc.getForm();

const rawUpdateFieldAppearances = form.updateFieldAppearances.bind(form);
form.updateFieldAppearances = () =>
rawUpdateFieldAppearances(customPdfFormFont);
Expand Down

0 comments on commit 4924f38

Please sign in to comment.