Skip to content

Commit 9bf93fb

Browse files
Merge pull request #1454 from OpenSignLabs/uncompatible_pdf
fix: incompatible pdf error while signing pdf
2 parents 403254a + f418e02 commit 9bf93fb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

apps/OpenSign/src/constant/Utils.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,6 @@ export const multiSignEmbed = async (widgets, pdfDoc, signyourself, scale) => {
14531453
if (position?.options?.values.length > 0) {
14541454
position?.options?.values.forEach((item, ind) => {
14551455
const checkboxRandomId = "checkbox" + randomId();
1456-
14571456
if (
14581457
position?.options?.response &&
14591458
position?.options?.response?.length > 0
@@ -1505,8 +1504,6 @@ export const multiSignEmbed = async (widgets, pdfDoc, signyourself, scale) => {
15051504
});
15061505
}
15071506
} else if (widgetTypeExist) {
1508-
const fontSize = position?.options?.fontSize || 12;
1509-
parseInt(fontSize);
15101507
let textContent;
15111508
if (position?.options?.response) {
15121509
textContent = position.options?.response;
@@ -1541,7 +1538,6 @@ export const multiSignEmbed = async (widgets, pdfDoc, signyourself, scale) => {
15411538
// Function to break text into lines based on when user go next line on press enter button
15421539
const breakTextIntoLines = (textContent, width) => {
15431540
const lines = [];
1544-
15451541
for (const word of textContent.split("\n")) {
15461542
const lineWidth = font.widthOfTextAtSize(`${word}`, fontSize);
15471543
//checking string length to container width
@@ -1583,7 +1579,6 @@ export const multiSignEmbed = async (widgets, pdfDoc, signyourself, scale) => {
15831579
y += 18; // Adjust the line height as needed
15841580
}
15851581
} else if (position.type === "dropdown") {
1586-
const fontsize = parseInt(position?.options?.fontSize) || 12;
15871582
const dropdownRandomId = "dropdown" + randomId();
15881583
const dropdown = form.createDropdown(dropdownRandomId);
15891584
dropdown.addOptions(position?.options?.values);
@@ -1598,10 +1593,10 @@ export const multiSignEmbed = async (widgets, pdfDoc, signyourself, scale) => {
15981593
// - `FontSize` is the size you want to set (e.g., 12)
15991594
// - `Tf` specifies the font and size
16001595
// - `0 g` sets the text color to black
1601-
const defaultAppearance = `/Helv ${fontsize} Tf 0 g`;
1596+
const defaultAppearance = `/Helv ${fontSize} Tf 0 g`;
16021597
// Set the default appearance for the dropdown field
16031598
dropdown.acroField.setDefaultAppearance(defaultAppearance);
1604-
dropdown.setFontSize(fontsize);
1599+
dropdown.setFontSize(fontSize);
16051600
const dropdownObj = {
16061601
x: xPos(position),
16071602
y: yPos(position),

0 commit comments

Comments
 (0)