feat(Hintergrund): Locate add, um die Position des Hintergrunds anhand anderer Anmerkungen zu berechnen.

- Standort des Hintergrunds zu Anmerkungen hinzugefügt
This commit is contained in:
Developer 02
2025-04-23 18:13:46 +02:00
parent e72ea534e5
commit d75da655d2
4 changed files with 57 additions and 19 deletions

View File

@@ -7,23 +7,28 @@ async function createAnnotations(document, instance) {
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,
})
if(annotParams.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(annotParams.background),
fontSize: 8,
});
const formFieldBackground = new PSPDFKit.FormFields.ButtonFormField({
name: id_background,
annotationIds: PSPDFKit.Immutable.List([annotation_background.id]),
value: "",
readOnly: false
});
const formFieldBackground = new PSPDFKit.FormFields.ButtonFormField({
name: id_background,
annotationIds: PSPDFKit.Immutable.List([annotation_background.id]),
value: "",
readOnly: false
})
signatures.push(annotation_background)
signatures.push(formFieldBackground)
}
//signatures
const id = PSPDFKit.generateInstantId()
@@ -175,9 +180,6 @@ async function createAnnotations(document, instance) {
readOnly: true
})
signatures.push(annotation_background)
signatures.push(formFieldBackground)
signatures.push(annotation)
signatures.push(formField)
signatures.push(annotation_date)