diff --git a/EnvelopeGenerator.Web/wwwroot/js/annotation.js b/EnvelopeGenerator.Web/wwwroot/js/annotation.js index a2b877a8..02330ed7 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/annotation.js +++ b/EnvelopeGenerator.Web/wwwroot/js/annotation.js @@ -3,7 +3,7 @@ const annotations = [] document.elements.forEach((element) => { - const [annotation, formField] = this.createAnnotationFromElement(element) + const [annotation, formField] = Annotation.createAnnotationFromElement(element) annotations.push(annotation) annotations.push(formField) }) @@ -24,14 +24,14 @@ } static async deleteAnnotations(instance) { - const allAnnotations = await this.getAnnotations(instance) - const pageAnnotations = allAnnotations.filter(this.isSignature) + const allAnnotations = await Annotation.getAnnotations(instance) + const pageAnnotations = allAnnotations.filter(Annotation.isSignature) //deleting all Annotations return await instance.delete(pageAnnotations) } static async validateAnnotations(instance) { - const allAnnotations = await this.getAnnotations(instance) + const allAnnotations = await Annotation.getAnnotations(instance) const pageAnnotations = allAnnotations .map((annotation) => { return annotation @@ -46,12 +46,12 @@ static createAnnotationFromElement(element) { const id = PSPDFKit.generateInstantId() - const width = this.inchToPoint(element.width) - const height = this.inchToPoint(element.height) - const top = this.inchToPoint(element.top) - height / 2 - const left = this.inchToPoint(element.left) - width / 2 + const width = Annotation.inchToPoint(element.width) + const height = Annotation.inchToPoint(element.height) + const top = Annotation.inchToPoint(element.top) - height / 2 + const left = Annotation.inchToPoint(element.left) - width / 2 const page = element.page - 1 - const annotation = this.createSignatureAnnotation( + const annotation = Annotation.createSignatureAnnotation( id, width, height, diff --git a/EnvelopeGenerator.Web/wwwroot/js/app.js b/EnvelopeGenerator.Web/wwwroot/js/app.js index 5f55c732..7e560e5f 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/app.js +++ b/EnvelopeGenerator.Web/wwwroot/js/app.js @@ -70,9 +70,7 @@ class App { // Load annotations into PSPDFKit try { this.signatureCount = this.currentDocument.elements.length - const annotations = Annotation.createAnnotations( - this.currentDocument - ) + const annotations = Annotation.createAnnotations(this.currentDocument) await this.Instance.create(annotations) const openResponse = await this.Network.openDocument(this.envelopeKey)