diff --git a/EnvelopeGenerator.Web/wwwroot/js/annotation.js b/EnvelopeGenerator.Web/wwwroot/js/annotation.js index 628583d9..05d85a31 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/annotation.js +++ b/EnvelopeGenerator.Web/wwwroot/js/annotation.js @@ -6,13 +6,32 @@ async function createAnnotations(document, instance) { const annotParams = await getAnnotationParams(element.left, element.top); const page = element.page - 1 + //background + const id_background = PSPDFKit.generateInstantId() + const annotation_background = new PSPDFKit.Annotations.WidgetAnnotation({ + id: id_background, + pageIndex: page, + formFieldName: id_background, + backgroundColor: PSPDFKit.Color.WHITE, + blendMode: 'normal', + //boundingBox: new PSPDFKit.Geometry.Rect({width: 152, height: 180, left: 186.09992, top: 648.8533600000001}), + fontSize: 8, + }) + + const formFieldBackground = new PSPDFKit.FormFields.ButtonFormField({ + name: id_background, + annotationIds: PSPDFKit.Immutable.List([annotation_background.id]), + value: "", + readOnly: false + }) + //signatures const id = PSPDFKit.generateInstantId() const annotation = new PSPDFKit.Annotations.WidgetAnnotation({ id: id, pageIndex: page, formFieldName: id, - backgroundColor: PSPDFKit.Color.YELLOW, + backgroundColor: PSPDFKit.Color.LIGHT_YELLOW, blendMode: 'multiply', boundingBox: new PSPDFKit.Geometry.Rect(annotParams.signature), }) @@ -131,7 +150,8 @@ async function createAnnotations(document, instance) { name: id_city_label, annotationIds: PSPDFKit.Immutable.List([annotation_city_label.id]), value: "Ort", - readOnly: true + readOnly: true, + color: PSPDFKit.Color.BLACK }) //position label @@ -155,6 +175,9 @@ async function createAnnotations(document, instance) { readOnly: true }) + signatures.push(annotation_background) + signatures.push(formFieldBackground) + signatures.push(annotation) signatures.push(formField) signatures.push(annotation_date)