@@ -42,11 +42,42 @@ function RenderPdf({
42
42
const isMobile = window . innerWidth < 767 ;
43
43
const newWidth = window . innerWidth ;
44
44
const scale = isMobile ? pdfOriginalWidth / newWidth : 1 ;
45
+
46
+ // handle signature block width and height according to screen
47
+ const posWidth = ( pos ) => {
48
+ let width ;
49
+ if ( isMobile ) {
50
+ if ( ! pos . isMobile ) {
51
+ width = pos . Width / scale ? pos . Width / scale : 150 / scale ;
52
+ return width ;
53
+ } else {
54
+ width = pos . Width ? pos . Width : 150 ;
55
+ return width ;
56
+ }
57
+ } else {
58
+ width = pos . Width ? pos . Width : 150 ;
59
+ return width ;
60
+ }
61
+ } ;
62
+ const posHeight = ( pos ) => {
63
+ let width ;
64
+ if ( isMobile ) {
65
+ if ( ! pos . isMobile ) {
66
+ width = pos . Height / scale ? pos . Height / scale : 60 / scale ;
67
+ return width ;
68
+ } else {
69
+ width = pos . Height ? pos . Height : 60 ;
70
+ return width ;
71
+ }
72
+ } else {
73
+ width = pos . Height ? pos . Height : 60 ;
74
+ return width ;
75
+ }
76
+ } ;
45
77
//check isGuestSigner is present in local if yes than handle login flow header in mobile view
46
78
const isGuestSigner = localStorage . getItem ( "isGuestSigner" ) ;
47
79
48
80
//function for render placeholder block over pdf document
49
-
50
81
const checkSignedSignes = ( data ) => {
51
82
const checkSign = signedSigners . filter (
52
83
( sign ) => sign . objectId === data . signerObjId
@@ -59,7 +90,7 @@ function RenderPdf({
59
90
if ( isMobile ) {
60
91
//if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale
61
92
if ( ! pos . isMobile ) {
62
- return pos . xPosition / scale ;
93
+ return pos . xPosition / scale - 20 ;
63
94
}
64
95
//pos.isMobile true -- placeholder save from mobile view(small device) handle position in mobile view(small screen) view divided by scale
65
96
else {
@@ -137,8 +168,8 @@ function RenderPdf({
137
168
borderWidth : "0.2px"
138
169
} }
139
170
size = { {
140
- width : pos . Width ? pos . Width : 150 ,
141
- height : pos . Height ? pos . Height : 60
171
+ width : posWidth ( pos ) ,
172
+ height : posHeight ( pos )
142
173
} }
143
174
lockAspectRatio = { pos . Width && 2.5 }
144
175
default = { {
@@ -208,8 +239,8 @@ function RenderPdf({
208
239
y : yPos ( pos )
209
240
} }
210
241
size = { {
211
- width : pos . Width ? pos . Width : 150 ,
212
- height : pos . Height ? pos . Height : 60
242
+ width : posWidth ( pos ) ,
243
+ height : posHeight ( pos )
213
244
} }
214
245
lockAspectRatio = { pos . Width ? pos . Width / pos . Height : 2.5 }
215
246
>
@@ -298,12 +329,11 @@ function RenderPdf({
298
329
borderWidth : "0.2px"
299
330
} }
300
331
size = { {
301
- width : pos . Width ? pos . Width : 150 ,
302
- height : pos . Height ? pos . Height : 60
332
+ width : posWidth ( pos ) ,
333
+ height : posHeight ( pos )
303
334
} }
304
335
lockAspectRatio = { pos . Width && 2.5 }
305
336
//if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divide by scale
306
-
307
337
//else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale
308
338
default = { {
309
339
x : ! pos . isMobile
@@ -365,14 +395,13 @@ function RenderPdf({
365
395
borderWidth : "0.2px"
366
396
} }
367
397
size = { {
368
- width : pos . Width ? pos . Width : 150 ,
369
- height : pos . Height ? pos . Height : 60
398
+ width : posWidth ( pos ) ,
399
+ height : posHeight ( pos )
370
400
} }
371
401
disableDragging = { true }
372
402
default = { {
373
403
//if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divide by scale
374
404
//else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale
375
-
376
405
x : ! pos . isMobile
377
406
? pos . xPosition / scale
378
407
: pos . xPosition * ( pos . scale / scale ) - 50 ,
0 commit comments