Hi there,
I have tested this issue with the following code. Could you try modifying it to match your signature, Ali?
const signatures = [
[
{ x: 10, y: 10 },
{ x: 50, y: 50 },
],
];
const latestAddedSignatureIndex = signatures.length - 1;
const canvas = document.createElement('canvas');
canvas.width = 500;
canvas.height = 500;
const ctx = canvas.getContext('2d');
ctx.lineWidth = 4;
ctx.strokeStyle = 'black';
ctx.beginPath();
const signatureArray = signatures[latestAddedSignatureIndex];
ctx.moveTo(signatureArray[0].x, signatureArray[0].y);
for (let i = 1; i < signatureArray.length; i++) {
ctx.lineTo(signatureArray[i].x, signatureArray[i].y);
}
ctx.stroke();
const signatureDataURL = canvas.toDataURL();
const signatureTool = instance.Core.documentViewer.getTool('AnnotationCreateSignature');
signatureTool.importSignatures([signatureDataURL]);
The signature seems to not appear because the canvas is too large. Could you try shrinking the size of the canvas?