Use invisible signature widget for borderless FirmaEC and bump to 1.2.24

This commit is contained in:
2026-05-22 14:10:43 -05:00
parent 5ed70766b9
commit fdde9cdb5d
9 changed files with 23 additions and 13 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "linkedsign-backend",
"version": "1.2.23",
"version": "1.2.24",
"private": true,
"description": "Initial backend for LinkedSign",
"main": "src/server.js",
+10 -4
View File
@@ -420,17 +420,23 @@ const signPdf = async ({
// ── Add cryptographic signature placeholder ───────────────────────
const pdfDocForSign = await PDFDocument.load(pdfWithStamp);
const placeholderPageIndex = Math.min(page, pdfDocForSign.getPageCount() - 1);
const placeholderPage = pdfDocForSign.getPages()[placeholderPageIndex];
const useInvisibleWidget = style === 'firmaec' && qrBorder === 'none';
const widgetRect = useInvisibleWidget
? [0, 0, 0, 0]
: [sx, sy, sx + sw, sy + sh];
pdflibAddPlaceholder({
pdfDoc: pdfDocForSign,
pdfPage: placeholderPage,
reason: reason || 'Firma digital',
contactInfo: signerName,
name: signerName,
location: location || '',
signatureLength: 32768,
rect: [sx, sy, sx + sw, sy + sh],
pageIndex: placeholderPageIndex,
widgetRect,
});
hideSignatureWidgetBorder(pdfDocForSign, placeholderPageIndex);
if (!useInvisibleWidget) {
hideSignatureWidgetBorder(pdfDocForSign, placeholderPageIndex);
}
const pdfWithPlaceholder = Buffer.from(await pdfDocForSign.save({ useObjectStreams: false }));