Skip to content

Commit 321316b

Browse files
author
Dolicraft
committed
Use a width ratio for the fichinter signature x position
Replace the hardcoded x=111 with round($s['w'] * 0.53) so the signature image keeps the known-good pre-21 position on A4 (210mm -> 111) while scaling for wider formats like Letter (215.9mm -> 114), as suggested in review. Signed-off-by: Dolicraft <contact@dolicraft.com>
1 parent 68b014c commit 321316b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

htdocs/core/ajax/onlineSign.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@
559559
if (getDolGlobalString("FICHINTER_SIGNATURE_XFORIMGSTART")) {
560560
$param['xforimgstart'] = getDolGlobalString("FICHINTER_SIGNATURE_XFORIMGSTART");
561561
} else {
562-
$param['xforimgstart'] = 111;
562+
$param['xforimgstart'] = (empty($s['w']) ? 110 : round($s['w'] * 0.53));
563563
}
564564
if (getDolGlobalString("FICHINTER_SIGNATURE_YFORIMGSTART")) {
565565
$param['yforimgstart'] = getDolGlobalString("FICHINTER_SIGNATURE_YFORIMGSTART");
@@ -585,7 +585,7 @@
585585
// A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF
586586
// TODO Get position of box from PDF template
587587

588-
$param['xforimgstart'] = 111;
588+
$param['xforimgstart'] = (empty($s['w']) ? 110 : round($s['w'] * 0.53));
589589
$param['yforimgstart'] = (empty($s['h']) ? 250 : $s['h'] - 60);
590590
$param['wforimg'] = $s['w'] - ($param['xforimgstart'] + 16);
591591

@@ -918,7 +918,7 @@
918918
// A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF
919919
// TODO Get position of box from PDF template
920920

921-
$param['xforimgstart'] = 111;
921+
$param['xforimgstart'] = (empty($s['w']) ? 110 : round($s['w'] * 0.53));
922922
$param['yforimgstart'] = (empty($s['h']) ? 250 : $s['h'] - 60);
923923
$param['wforimg'] = $s['w'] - ($param['xforimgstart'] + 16);
924924

@@ -935,7 +935,7 @@
935935
// A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF
936936
// TODO Get position of box from PDF template
937937

938-
$param['xforimgstart'] = 111;
938+
$param['xforimgstart'] = (empty($s['w']) ? 110 : round($s['w'] * 0.53));
939939
$param['yforimgstart'] = (empty($s['h']) ? 250 : $s['h'] - 60);
940940
$param['wforimg'] = $s['w'] - ($param['xforimgstart'] + 16);
941941

0 commit comments

Comments
 (0)