diff --git a/EnvelopeGenerator.Web/Scripts/app.ts b/EnvelopeGenerator.Web/Scripts/app.ts index d3611ccf..75502c1a 100644 --- a/EnvelopeGenerator.Web/Scripts/app.ts +++ b/EnvelopeGenerator.Web/Scripts/app.ts @@ -217,6 +217,21 @@ class Annotation { return await instance.delete(pageAnnotations); } + public async validateAnnotations(instance: Instance): Promise { + 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] { const id = PSPDFKit.generateInstantId() const width = this.inchToPoint(element.width)