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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user