Show app version in sidebar and split 4-word FirmaEC names in 1.2.26

This commit is contained in:
2026-05-22 14:31:10 -05:00
parent 81bd8d3c59
commit 3c9aefa10e
11 changed files with 44 additions and 12 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "linkedsign-backend",
"version": "1.2.25",
"version": "1.2.26",
"private": true,
"description": "Initial backend for LinkedSign",
"main": "src/server.js",
+18 -2
View File
@@ -59,6 +59,23 @@ function wrapToLines(text, font, size, maxWidth, maxLines) {
return lines;
}
function getFirmaEcNameLines(signerName, font, size, maxWidth) {
const words = String(signerName || '')
.trim()
.toUpperCase()
.split(/\s+/)
.filter(Boolean);
if (words.length === 4) {
return [
words.slice(0, 2).join(' '),
words.slice(2).join(' '),
].map((line) => truncate(line, font, size, maxWidth));
}
return wrapToLines(words.join(' '), font, size, maxWidth, 2);
}
function buildLocalizedSignatureTimestamp({ locale, timeZone } = {}) {
const now = new Date();
const normalizedLocale = locale || 'es-EC';
@@ -343,9 +360,8 @@ async function drawStyleFirmaEC(pdfDoc, page, sx, sy, sw, sh, { signerName, veri
page.drawText('Firmado electronicamente por:', { x: textX, y: sy + sh - 21, size: 6, font: fReg, color: rgb(0.12, 0.12, 0.14) });
// Name — bold, uppercase, word-wrapped up to 2 lines
const nameUpper = signerName.toUpperCase();
const nameSize = 8.5;
const nameLines = wrapToLines(nameUpper, fBold, nameSize, textW, 2);
const nameLines = getFirmaEcNameLines(signerName, fBold, nameSize, textW);
nameLines.forEach((line, i) => {
page.drawText(line, { x: textX, y: sy + sh - 34 - (i * 13), size: nameSize, font: fBold, color: rgb(0.05, 0.05, 0.07) });
});