refactor(app): simplify annotation creation and improve signature handling

- Updated `createImageAnnotation` to use pre-generated id instead of multiple parameters
- Replaced hardcoded annotation ID generation during signature creation
- Added `fixBase64` helper to handle escaped base64 strings
- Temporarily added logging in `handleFinish` for debugging exported InstantJSON
- Simplified `createImageAnnotation` signature and usage
- Improved readability and consistency in annotation ID generation logic
This commit is contained in:
2025-10-17 13:46:07 +02:00
parent f046be240b
commit 52306d481f
3 changed files with 21 additions and 8 deletions

View File

@@ -217,9 +217,9 @@ function isSignature(annotation) {
return !!annotation.isSignature || annotation.description == 'FRAME'
}
function createImageAnnotation(boundingBox, pageIndex, imageAttachmentId, envelopeId, receiverId, elementId, annotationType) {
function createImageAnnotation(boundingBox, pageIndex, imageAttachmentId, id) {
const frameAnnotation = new PSPDFKit.Annotations.ImageAnnotation({
id: generateId(envelopeId, receiverId, elementId, annotationType),
id: id,
pageIndex: pageIndex,
isSignature: false,
readOnly: true,