diff --git a/microfrontends/SignDocuments/src/Component/component/renderPdf.js b/microfrontends/SignDocuments/src/Component/component/renderPdf.js index 1bef2efbf..40456eb6c 100644 --- a/microfrontends/SignDocuments/src/Component/component/renderPdf.js +++ b/microfrontends/SignDocuments/src/Component/component/renderPdf.js @@ -42,6 +42,39 @@ function RenderPdf({ const isMobile = window.innerWidth < 767; const newWidth = window.innerWidth; const scale = isMobile ? pdfOriginalWidth / newWidth : 1; + //check isSigner is present in local if yes than handle login flow header in mobile view + const isSigner = localStorage.getItem("isSigner"); + // handle signature block width and height according to screen + const posWidth = (pos) => { + let width; + if (isMobile) { + if (!pos.isMobile) { + width = pos.Width / scale ? pos.Width / scale : 150 / scale; + return width; + } else { + width = pos.Width ? pos.Width : 150; + return width; + } + } else { + width = pos.Width ? pos.Width : 150; + return width; + } + }; + const posHeight = (pos) => { + let width; + if (isMobile) { + if (!pos.isMobile) { + width = pos.Height / scale ? pos.Height / scale : 60 / scale; + return width; + } else { + width = pos.Height ? pos.Height : 60; + return width; + } + } else { + width = pos.Height ? pos.Height : 60; + return width; + } + }; //function for render placeholder block over pdf document const checkSignedSignes = (data) => { @@ -56,7 +89,7 @@ function RenderPdf({ if (isMobile) { //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale if (!pos.isMobile) { - return pos.xPosition / scale; + return pos.xPosition / scale - 20; } //pos.isMobile true -- placeholder save from mobile view(small device) handle position in mobile view(small screen) view divided by scale else { @@ -134,8 +167,8 @@ function RenderPdf({ borderWidth: "0.2px" }} size={{ - width: pos.Width ? pos.Width : 150, - height: pos.Height ? pos.Height : 60 + width: posWidth(pos), + height: posHeight(pos) }} lockAspectRatio={pos.Width && 2.5} default={{ @@ -205,8 +238,8 @@ function RenderPdf({ y: yPos(pos) }} size={{ - width: pos.Width ? pos.Width : 150, - height: pos.Height ? pos.Height : 60 + width: posWidth(pos), + height: posHeight(pos) }} lockAspectRatio={pos.Width ? pos.Width / pos.Height : 2.5} > @@ -235,7 +268,8 @@ function RenderPdf({ {isMobile && scale ? (