add validateAnnotations
This commit is contained in:
parent
f4549c0481
commit
a1bec774cd
@ -217,6 +217,21 @@ class Annotation {
|
|||||||
return await instance.delete(pageAnnotations);
|
return await instance.delete(pageAnnotations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async validateAnnotations(instance: Instance): Promise<boolean> {
|
||||||
|
let pageAnnotations = (
|
||||||
|
await Promise.all(Array.from({ length: instance.totalPageCount }).map((_, pageIndex) =>
|
||||||
|
instance.getAnnotations(pageIndex)
|
||||||
|
))
|
||||||
|
).flatMap((annotations) =>
|
||||||
|
annotations.reduce((acc, annotation) => acc.concat(annotation), [])
|
||||||
|
).map((annotation: WidgetAnnotation) => {
|
||||||
|
console.log(annotation.toJS());
|
||||||
|
return annotation;
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private createAnnotationFromElement(element: Element): [annotation: WidgetAnnotation, formField: SignatureFormFieldType] {
|
private createAnnotationFromElement(element: Element): [annotation: WidgetAnnotation, formField: SignatureFormFieldType] {
|
||||||
const id = PSPDFKit.generateInstantId()
|
const id = PSPDFKit.generateInstantId()
|
||||||
const width = this.inchToPoint(element.width)
|
const width = this.inchToPoint(element.width)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user