feat(annotation): enhance mapSignature to support drawn signatures
- Added support for mapping drawn (non-image) signatures by including `lines` and `strokeColor` data. - Added error handling for incompatible or missing signature data structures. - Ensures compatibility with third-party annotation libraries that return vector-based signatures.
This commit is contained in:
parent
04ae14c660
commit
7919f02ffd
@ -335,6 +335,13 @@ function mapSignature(iJSON) {
|
|||||||
signatures: iJSON.annotations.filter(annot => annot.isSignature).map(annot => {
|
signatures: iJSON.annotations.filter(annot => annot.isSignature).map(annot => {
|
||||||
if (annot.imageAttachmentId)
|
if (annot.imageAttachmentId)
|
||||||
annot.value = iJSON.attachments[annot.imageAttachmentId]?.binary;
|
annot.value = iJSON.attachments[annot.imageAttachmentId]?.binary;
|
||||||
|
else if (annot.lines && annot.strokeColor)
|
||||||
|
annot.value = JSON.stringify({
|
||||||
|
lines: annot.lines,
|
||||||
|
strokeColor: annot.strokeColor
|
||||||
|
});
|
||||||
|
else
|
||||||
|
throw new Error("Signature mapping failed: The data structure from the third-party library is incompatible or missing required fields.");
|
||||||
|
|
||||||
annot.name = 'signature';
|
annot.name = 'signature';
|
||||||
return annot;
|
return annot;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
EnvelopeGenerator.Web/wwwroot/js/app.min.js
vendored
2
EnvelopeGenerator.Web/wwwroot/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user