10.01.2024

This commit is contained in:
Jonathan Jenne
2024-01-10 09:31:04 +01:00
parent b7fbb21076
commit 277f5d3f0d
8 changed files with 148 additions and 27 deletions

View File

@@ -26,17 +26,15 @@
}
async deleteAnnotations(instance) {
let pageAnnotations = this.getAnnotations(instance)
.filter(
(annotation) =>
!!annotation.isSignature || annotation.description == 'FRAME'
)
const allAnnotations = await this.getAnnotations(instance)
const pageAnnotations = allAnnotations.filter(this.isSignature)
//deleting all Annotations
return await instance.delete(pageAnnotations)
}
}
async validateAnnotations(instance) {
let pageAnnotations = this.getAnnotations(instance)
const allAnnotations = await this.getAnnotations(instance)
const pageAnnotations = allAnnotations
.map((annotation) => {
console.log(annotation.toJS())
return annotation
@@ -45,6 +43,10 @@
return true
}
isSignature(annotation) {
return !!annotation.isSignature || annotation.description == 'FRAME'
}
createAnnotationFromElement(element) {
const id = PSPDFKit.generateInstantId()
const width = this.inchToPoint(element.width)