From aed55e9bcd3cf15c07f1328a79af69b22d75c3da Mon Sep 17 00:00:00 2001 From: Catalin Pit Date: Fri, 30 Jan 2026 14:39:06 +0200 Subject: [PATCH] fix: checkbox states not showing in signed PDF for legacy uploads Flatten the pdf-lib form before saving to bake checkbox/radio appearances into the PDF content. This ensures checked states are preserved when the PDF is subsequently processed by libpdf for final signing. --- .../lib/jobs/definitions/internal/seal-document.handler.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/lib/jobs/definitions/internal/seal-document.handler.ts b/packages/lib/jobs/definitions/internal/seal-document.handler.ts index b46996e51..ff6aae66a 100644 --- a/packages/lib/jobs/definitions/internal/seal-document.handler.ts +++ b/packages/lib/jobs/definitions/internal/seal-document.handler.ts @@ -388,6 +388,11 @@ const decorateAndSignPdf = async ({ } } + // Flatten the form to bake checkbox/radio appearances into the PDF content + // This ensures proper rendering when the PDF is processed by libpdf + const form = legacy_pdfLibDoc.getForm(); + form.flatten(); + await pdfDoc.reload(await legacy_pdfLibDoc.save()); }