Skip to content

Commit 04a3251

Browse files
fix issue of mulitple annotation in signyourself (#174)
1 parent 82694a2 commit 04a3251

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

microfrontends/SignDocuments/src/Component/SignYourselfPdf.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ function SignYourSelf() {
500500
removeBase64Fromjpeg,
501501
""
502502
);
503-
504503
//function for call to embed signature in pdf and get digital signature pdf
505504
signPdfFun(newImgUrl, documentId, data, pdfBase64, pageNo);
506505
})
@@ -575,14 +574,18 @@ function SignYourSelf() {
575574
const scale = isMobile ? pdfOriginalWidth / newWidth : 1;
576575

577576
const posY = () => {
578-
if (id === 0) {
579-
return (
580-
page.getHeight() -
581-
imgUrlList[id].yPosition * scale -
582-
imgHeight
583-
);
584-
} else if (id > 0) {
585-
return page.getHeight() - imgUrlList[id].yPosition * scale;
577+
if (isMobile) {
578+
if (id === 0) {
579+
return (
580+
page.getHeight() -
581+
imgUrlList[id].yPosition * scale -
582+
imgHeight
583+
);
584+
} else if (id > 0) {
585+
return page.getHeight() - imgUrlList[id].yPosition * scale;
586+
}
587+
} else {
588+
return page.getHeight() - imgUrlList[id].yPosition - imgHeight;
586589
}
587590
};
588591
page.drawImage(img, {
@@ -596,7 +599,6 @@ function SignYourSelf() {
596599
});
597600
}
598601
const pdfBytes = await pdfDoc.saveAsBase64({ useObjectStreams: false });
599-
600602
signPdfFun(pdfBytes, documentId);
601603
}
602604
setIsSignPad(false);
@@ -615,10 +617,11 @@ function SignYourSelf() {
615617
pageNo
616618
) => {
617619
let singleSign;
620+
618621
const isMobile = window.innerWidth < 767;
619622
const newWidth = window.innerWidth;
620623
const scale = isMobile ? pdfOriginalWidth / newWidth : 1;
621-
const imgWidth = xyPosData.Width.Width ? xyPosData.Width.Width : 150;
624+
const imgWidth = xyPosData ? xyPosData.Width : 150;
622625
if (xyPostion.length === 1 && xyPostion[0].pos.length === 1) {
623626
const height = xyPosData.Height ? xyPosData.Height : 60;
624627
const bottomY = xyPosData.isDrag
@@ -1115,6 +1118,8 @@ function SignYourSelf() {
11151118
pdfDetails={pdfDetails}
11161119
isShowHeader={true}
11171120
currentSigner={true}
1121+
alreadySign={pdfUrl ? true : false}
1122+
isSignYourself={true}
11181123
/>
11191124

11201125
{/* className="hidePdf" */}

0 commit comments

Comments
 (0)