|
@@ -633,8 +633,11 @@ class CPDFWorker {
|
|
setAnnotAuthor(annotation)
|
|
setAnnotAuthor(annotation)
|
|
}
|
|
}
|
|
|
|
|
|
- if (annotation.operate === 'mod-form') Module._UpdateFormAp(annotation.annotPtr)
|
|
|
|
- else Module._UpdateAnnotAp(annotation.annotPtr, 0)
|
|
|
|
|
|
+ if (annotation.operate === 'mod-form' && annotation.type !== 'signatureFields') {
|
|
|
|
+ Module._UpdateFormAp(annotation.annotPtr)
|
|
|
|
+ } else {
|
|
|
|
+ Module._UpdateAnnotAp(annotation.annotPtr, 0)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
messageHandler.on('FlattenPage', (data) => {
|
|
messageHandler.on('FlattenPage', (data) => {
|
|
@@ -2411,6 +2414,20 @@ function createWidget(doc, pagePtr, annotation) {
|
|
})
|
|
})
|
|
|
|
|
|
Module._UpdateFormAp(annotPtr)
|
|
Module._UpdateFormAp(annotPtr)
|
|
|
|
+
|
|
|
|
+ if (type === 'signatureFields') {
|
|
|
|
+ const { imageBase64 } = annotation
|
|
|
|
+ if (imageBase64) {
|
|
|
|
+ const imageData = convertBase64ToBytes(imageBase64)
|
|
|
|
+
|
|
|
|
+ ComPDFKitJS.opened_image = []
|
|
|
|
+ ComPDFKitJS.opened_image[0] = imageData
|
|
|
|
+
|
|
|
|
+ Module._RemoveAP(annotPtr)
|
|
|
|
+ Module._SetImageStampByStream(annotPtr, 0, imageData.length, 0)
|
|
|
|
+ Module._SignWithName(annotPtr)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return {
|
|
return {
|
|
annotPtr
|
|
annotPtr
|
|
}
|
|
}
|