fix(annotation): correctly assign elementId for signature annotations
Previously, signature annotations did not include elementId mapping logic, which caused issues when linking annotations to their corresponding elements. This update adds logic to extract elementId from the nearest signature annotation (similar to frame annotations) to ensure proper association.
This commit is contained in:
@@ -333,6 +333,9 @@ function mapSignature(iJSON) {
|
||||
return annot;
|
||||
}),
|
||||
signatures: iJSON.annotations.filter(annot => annot.isSignature).map(annot => {
|
||||
const preElement = findNearest(annot, e => e.bbox[0], e => e.bbox[1], ...iJSON.annotations.filter(field => field.id.includes("signature")));
|
||||
const idPartsOfPre = preElement.id.split('#');
|
||||
annot.elementId = Number(idPartsOfPre[2]);
|
||||
if (annot.imageAttachmentId)
|
||||
annot.value = iJSON.attachments[annot.imageAttachmentId]?.binary;
|
||||
else if (annot.lines && annot.strokeColor)
|
||||
|
||||
Reference in New Issue
Block a user