Skip to content

Commit

Permalink
fix: multiple dropdown embed issue
Browse files Browse the repository at this point in the history
  • Loading branch information
raktima-opensignlabs committed Mar 6, 2024
1 parent 36a4139 commit a53f919
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,7 @@ function PdfRequestFiles() {
position.type !== "radio" &&
position.type !== "checkbox"
);

if (requiredWidgets && requiredCheckbox?.length > 0) {
if (requiredWidgets && requiredWidgets?.length > 0) {
unSignUrlData = checkUser[0].placeHolder[i].pos.filter(
(pos) => !pos?.SignUrl && !pos.options.response
);
Expand Down Expand Up @@ -535,7 +534,6 @@ function PdfRequestFiles() {
containerWH
);

// console.log('pdfte',pdfBytes)
//function for call to embed signature in pdf and get digital signature pdf
try {
const res = await signPdfFun(
Expand Down
11 changes: 6 additions & 5 deletions microfrontends/SignDocuments/src/utils/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export const defaultWidthHeight = (type) => {
case "image":
return { width: 70, height: 70 };
case "email":
return { width: 150, height: 20 };
return { width: 150, height: 25 };
case "radio":
return { width: 15, height: 30 };
case "label":
Expand Down Expand Up @@ -448,7 +448,6 @@ export const convertPNGtoJPEG = (base64Data) => {

resolve(jpegBase64Data);
};

img.onerror = (error) => {
reject(error);
};
Expand Down Expand Up @@ -1200,14 +1199,15 @@ export const multiSignEmbed = async (
color: rgb(0, 0, 0)
});
} else if (position.type === "dropdown") {
const dropdown = form.createDropdown(randomboxId);
const dropdownRandomId = "dropdown" + randomId();
const dropdown = form.createDropdown(dropdownRandomId);
dropdown.addOptions(position?.options?.values);

if (position?.options?.response) {
dropdown.select(position.options?.response);
} else if (position?.options?.defaultValue) {
dropdown.select(position?.options?.defaultValue);
}

dropdown.addToPage(page, {
x: xPos(position),
y: yPos(position),
Expand All @@ -1216,7 +1216,8 @@ export const multiSignEmbed = async (
});
dropdown.enableReadOnly();
} else if (position.type === "radio") {
const radioGroup = form.createRadioGroup(randomboxId);
const radioRandomId = "radio" + randomId();
const radioGroup = form.createRadioGroup(radioRandomId);
let addYPosition = 18;

for (let i = 1; i <= position?.options?.values.length; i++) {
Expand Down

0 comments on commit a53f919

Please sign in to comment.