Use invisible signature widget for borderless FirmaEC and bump to 1.2.24
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user