mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-11 20:27:39 +02:00
fix: Ip address overlap with security level in certificate
This commit is contained in:
@@ -15,6 +15,7 @@ export default async function GenerateCertificate(docDetails) {
|
|||||||
const title = 25;
|
const title = 25;
|
||||||
const subtitle = 20;
|
const subtitle = 20;
|
||||||
const text = 14;
|
const text = 14;
|
||||||
|
const timeText = 11;
|
||||||
const textKeyColor = rgb(0.12, 0.12, 0.12);
|
const textKeyColor = rgb(0.12, 0.12, 0.12);
|
||||||
const textValueColor = rgb(0.3, 0.3, 0.3);
|
const textValueColor = rgb(0.3, 0.3, 0.3);
|
||||||
const completedAt = new Date();
|
const completedAt = new Date();
|
||||||
@@ -280,17 +281,17 @@ export default async function GenerateCertificate(docDetails) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
page.drawText('Viewed on :', {
|
page.drawText('Viewed on :', {
|
||||||
x: half,
|
x: half +55,
|
||||||
y: yPosition2,
|
y: yPosition2,
|
||||||
size: text,
|
size: timeText,
|
||||||
font: timesRomanFont,
|
font: timesRomanFont,
|
||||||
color: textKeyColor,
|
color: textKeyColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
page.drawText(`${new Date(x.ViewedOn).toUTCString()}`, {
|
page.drawText(`${new Date(x.ViewedOn).toUTCString()}`, {
|
||||||
x: half + 75,
|
x: half + 112,
|
||||||
y: yPosition2,
|
y: yPosition2,
|
||||||
size: text,
|
size: timeText,
|
||||||
font: timesRomanFont,
|
font: timesRomanFont,
|
||||||
color: textValueColor,
|
color: textValueColor,
|
||||||
});
|
});
|
||||||
@@ -312,17 +313,17 @@ export default async function GenerateCertificate(docDetails) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
page.drawText('Signed on :', {
|
page.drawText('Signed on :', {
|
||||||
x: half,
|
x: half + 55,
|
||||||
y: yPosition3,
|
y: yPosition3 + 5,
|
||||||
size: text,
|
size: timeText,
|
||||||
font: timesRomanFont,
|
font: timesRomanFont,
|
||||||
color: textKeyColor,
|
color: textKeyColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
page.drawText(`${new Date(x.SignedOn).toUTCString()}`, {
|
page.drawText(`${new Date(x.SignedOn).toUTCString()}`, {
|
||||||
x: half + 70,
|
x: half + 108,
|
||||||
y: yPosition3,
|
y: yPosition3 + 5,
|
||||||
size: text,
|
size: timeText,
|
||||||
font: timesRomanFont,
|
font: timesRomanFont,
|
||||||
color: textValueColor,
|
color: textValueColor,
|
||||||
});
|
});
|
||||||
@@ -338,22 +339,22 @@ export default async function GenerateCertificate(docDetails) {
|
|||||||
page.drawText(x?.ipAddress, {
|
page.drawText(x?.ipAddress, {
|
||||||
x: 100,
|
x: 100,
|
||||||
y: yPosition4,
|
y: yPosition4,
|
||||||
size: text,
|
size: 13,
|
||||||
font: timesRomanFont,
|
font: timesRomanFont,
|
||||||
color: textValueColor,
|
color: textValueColor,
|
||||||
});
|
});
|
||||||
page.drawText('Security level :', {
|
page.drawText('Security level :', {
|
||||||
x: half,
|
x: half + 55,
|
||||||
y: yPosition4,
|
y: yPosition4 + 10,
|
||||||
size: text,
|
size: timeText,
|
||||||
font: timesRomanFont,
|
font: timesRomanFont,
|
||||||
color: textKeyColor,
|
color: textKeyColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
page.drawText(`Email, OTP Auth`, {
|
page.drawText(`Email, OTP Auth`, {
|
||||||
x: half + 90,
|
x: half + 125,
|
||||||
y: yPosition4,
|
y: yPosition4 + 10,
|
||||||
size: text,
|
size: timeText,
|
||||||
font: timesRomanFont,
|
font: timesRomanFont,
|
||||||
color: textValueColor,
|
color: textValueColor,
|
||||||
});
|
});
|
||||||
@@ -368,7 +369,7 @@ export default async function GenerateCertificate(docDetails) {
|
|||||||
|
|
||||||
page.drawRectangle({
|
page.drawRectangle({
|
||||||
x: 98,
|
x: 98,
|
||||||
y: yPosition5 - 27,
|
y: yPosition5 - 30,
|
||||||
width: 104,
|
width: 104,
|
||||||
height: 44,
|
height: 44,
|
||||||
borderColor: rgb(0.22, 0.18, 0.47),
|
borderColor: rgb(0.22, 0.18, 0.47),
|
||||||
@@ -377,7 +378,7 @@ export default async function GenerateCertificate(docDetails) {
|
|||||||
if (embedPng) {
|
if (embedPng) {
|
||||||
page.drawImage(embedPng, {
|
page.drawImage(embedPng, {
|
||||||
x: 100,
|
x: 100,
|
||||||
y: yPosition5 - 25,
|
y: yPosition5 - 27,
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 40,
|
height: 40,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user