From 4f463c27e6a857137bc7b077e1aff0e231337ef6 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 20 Oct 2025 11:28:05 +0200 Subject: [PATCH] feat(annotation): extend mapSignature to include FRAME annotations - Updated `mapSignature` function to also map image/frame annotations. - For each annotation with `description === 'FRAME'`, add `name` and `value` based on corresponding attachment. - Preserves existing mapping of form fields, filtering out labels. - Ensures signature data and associated frames are returned in a structured object. --- EnvelopeGenerator.Web/wwwroot/js/annotation.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EnvelopeGenerator.Web/wwwroot/js/annotation.js b/EnvelopeGenerator.Web/wwwroot/js/annotation.js index 291b43ce..1a54d193 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/annotation.js +++ b/EnvelopeGenerator.Web/wwwroot/js/annotation.js @@ -316,6 +316,11 @@ function mapSignature(iJSON) { field.elementId = Number(nameParts[2]); field.name = nameParts[3]; return field; + }), + frames: iJSON.annotations.filter(annot => annot.description === 'FRAME').map((annot) => { + annot.name = annot.description.toLowerCase(); + annot.value = iJSON.attachments[annot.imageAttachmentId]?.binary || null; + return annot; }) }; } \ No newline at end of file