Skip to content

Commit 082f056

Browse files
Merge pull request #673 from OpenSignLabs/signPdf
2 parents 7b0f0d5 + b01618c commit 082f056

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

apps/OpenSignServer/cloud/parsefunction/pdf/GenerateCertificate.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default async function GenerateCertificate(docDetails) {
1515
const title = 25;
1616
const subtitle = 20;
1717
const text = 14;
18+
const timeText = 11;
1819
const textKeyColor = rgb(0.12, 0.12, 0.12);
1920
const textValueColor = rgb(0.3, 0.3, 0.3);
2021
const completedAt = new Date();
@@ -280,17 +281,17 @@ export default async function GenerateCertificate(docDetails) {
280281
});
281282

282283
page.drawText('Viewed on :', {
283-
x: half,
284+
x: half +55,
284285
y: yPosition2,
285-
size: text,
286+
size: timeText,
286287
font: timesRomanFont,
287288
color: textKeyColor,
288289
});
289290

290291
page.drawText(`${new Date(x.ViewedOn).toUTCString()}`, {
291-
x: half + 75,
292+
x: half + 112,
292293
y: yPosition2,
293-
size: text,
294+
size: timeText,
294295
font: timesRomanFont,
295296
color: textValueColor,
296297
});
@@ -312,17 +313,17 @@ export default async function GenerateCertificate(docDetails) {
312313
});
313314

314315
page.drawText('Signed on :', {
315-
x: half,
316-
y: yPosition3,
317-
size: text,
316+
x: half + 55,
317+
y: yPosition3 + 5,
318+
size: timeText,
318319
font: timesRomanFont,
319320
color: textKeyColor,
320321
});
321322

322323
page.drawText(`${new Date(x.SignedOn).toUTCString()}`, {
323-
x: half + 70,
324-
y: yPosition3,
325-
size: text,
324+
x: half + 108,
325+
y: yPosition3 + 5,
326+
size: timeText,
326327
font: timesRomanFont,
327328
color: textValueColor,
328329
});
@@ -338,22 +339,22 @@ export default async function GenerateCertificate(docDetails) {
338339
page.drawText(x?.ipAddress, {
339340
x: 100,
340341
y: yPosition4,
341-
size: text,
342+
size: 13,
342343
font: timesRomanFont,
343344
color: textValueColor,
344345
});
345346
page.drawText('Security level :', {
346-
x: half,
347-
y: yPosition4,
348-
size: text,
347+
x: half + 55,
348+
y: yPosition4 + 10,
349+
size: timeText,
349350
font: timesRomanFont,
350351
color: textKeyColor,
351352
});
352353

353354
page.drawText(`Email, OTP Auth`, {
354-
x: half + 90,
355-
y: yPosition4,
356-
size: text,
355+
x: half + 125,
356+
y: yPosition4 + 10,
357+
size: timeText,
357358
font: timesRomanFont,
358359
color: textValueColor,
359360
});
@@ -368,7 +369,7 @@ export default async function GenerateCertificate(docDetails) {
368369

369370
page.drawRectangle({
370371
x: 98,
371-
y: yPosition5 - 27,
372+
y: yPosition5 - 30,
372373
width: 104,
373374
height: 44,
374375
borderColor: rgb(0.22, 0.18, 0.47),
@@ -377,7 +378,7 @@ export default async function GenerateCertificate(docDetails) {
377378
if (embedPng) {
378379
page.drawImage(embedPng, {
379380
x: 100,
380-
y: yPosition5 - 25,
381+
y: yPosition5 - 27,
381382
width: 100,
382383
height: 40,
383384
});

0 commit comments

Comments
 (0)