|
@@ -2925,6 +2925,14 @@ class ComPDFKitViewer {
|
|
|
});
|
|
|
|
|
|
this.pdfViewer.refresh()
|
|
|
+
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ const eventHandler = () => {
|
|
|
+ this.eventBus._off('pagerendered', eventHandler)
|
|
|
+ resolve()
|
|
|
+ }
|
|
|
+ this.eventBus._on('pagerendered', eventHandler)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
setPropertyPanel(props) {
|
|
@@ -4306,25 +4314,37 @@ class ComPDFKitViewer {
|
|
|
const redactions = Array.isArray(redaction) ? redaction : [redaction]
|
|
|
redactionList = redactions
|
|
|
}
|
|
|
- redactionList.forEach(async item => {
|
|
|
+ for (const item of redactionList) {
|
|
|
if (item.erasure) {
|
|
|
if (item.rects && item.rects.length) {
|
|
|
- item.rects.forEach(async rect => {
|
|
|
+ for (const rect of item.rects) {
|
|
|
await this.messageHandler.sendWithPromise('ErasureRedactionFromRect', { pagePtr: item.pagePtr, rect })
|
|
|
- })
|
|
|
+ }
|
|
|
} else {
|
|
|
await this.messageHandler.sendWithPromise('ErasureRedactionFromRect', { pagePtr: item.pagePtr, rect: item.rect })
|
|
|
}
|
|
|
} else {
|
|
|
await this.messageHandler.sendWithPromise('ApplyRedaction', { annotPtr: item.annotPtr })
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ await this.updateTextPtr()
|
|
|
+ this.emptyAnnotations()
|
|
|
+ this.pdfViewer.refresh()
|
|
|
+ this.reRenderAnnotations()
|
|
|
+
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ const eventHandler = () => {
|
|
|
+ this.eventBus._off('annotationChanged', eventHandler)
|
|
|
+ resolve()
|
|
|
+ }
|
|
|
+ this.eventBus._on('annotationChanged', eventHandler)
|
|
|
})
|
|
|
- await this.delAnnotations(redactionList)
|
|
|
- } else {
|
|
|
- await this.delAnnotations(this.redactionList)
|
|
|
- this.redactionList.length = 0
|
|
|
}
|
|
|
- await this.updateTextPtr()
|
|
|
+
|
|
|
+ await this.delAnnotations(this.redactionList)
|
|
|
+ this.redactionList.length = 0
|
|
|
+ this.pdfViewer.refresh()
|
|
|
}
|
|
|
}
|
|
|
|