Skip to content

Commit 08b8346

Browse files
fix: text box widgets font size issue
1 parent a5f8e4f commit 08b8346

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

apps/OpenSign/src/components/pdf/PlaceholderType.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function PlaceholderType(props) {
3131
const years = range(1990, getYear(new Date()) + 16, 1);
3232
const height = props.posHeight(props.pos, props.isSignYourself);
3333
const fontSize =
34-
(props.pos.options?.fontSize || (height > 14 ? 12 : height / 2)) + "px";
34+
(props.pos.options?.fontSize || (height ? height - 4 : 12)) + "px";
3535
const fontColor = props.pos.options?.fontColor || "black";
3636
const months = [
3737
"January",

apps/OpenSign/src/constant/Utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ const calculateFontSize = (
12901290
widgetHeight
12911291
) => {
12921292
const font =
1293-
position?.options?.fontSize || widgetHeight > 14 ? 12 : widgetHeight / 2;
1293+
position?.options?.fontSize || (widgetHeight ? widgetHeight / 2 : 12);
12941294
if (!signyourself && position?.isMobile && position?.scale) {
12951295
return font / position?.scale / containerScale;
12961296
} else {
@@ -1487,7 +1487,7 @@ export const multiSignEmbed = async (
14871487
position,
14881488
containerScale,
14891489
signyourself,
1490-
widgetHeight
1490+
position.Height
14911491
);
14921492
parseInt(fontSize);
14931493
let textContent;
@@ -1662,7 +1662,7 @@ export const multiSignEmbed = async (
16621662
});
16631663
}
16641664
const pdfBytes = await pdfDoc.saveAsBase64({ useObjectStreams: false });
1665-
// console.log("pdf", pdfBytes);
1665+
//console.log("pdf", pdfBytes);
16661666
return pdfBytes;
16671667
};
16681668

0 commit comments

Comments
 (0)