feat(postion): Hinzufügen und Konfigurieren von Positions- und Positionsbeschriftungsannotationen.
This commit is contained in:
@@ -162,12 +162,26 @@
|
|||||||
"MarginTop": 0
|
"MarginTop": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "CityLabel",
|
"Name": "PositionLabel",
|
||||||
"VerBoundAnnotName": "Signature",
|
"VerBoundAnnotName": "Signature",
|
||||||
"WidthRatio": 1.2,
|
"WidthRatio": 1.2,
|
||||||
"HeightRatio": 0.5,
|
"HeightRatio": 0.5,
|
||||||
"MarginTopRatio": 0.25
|
"MarginTopRatio": 0.25
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Name": "Position",
|
||||||
|
"VerBoundAnnotName": "PositionLabel",
|
||||||
|
"WidthRatio": 1.2,
|
||||||
|
"HeightRatio": 0.5,
|
||||||
|
"MarginTopRatio": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "CityLabel",
|
||||||
|
"VerBoundAnnotName": "Position",
|
||||||
|
"WidthRatio": 1.2,
|
||||||
|
"HeightRatio": 0.5,
|
||||||
|
"MarginTopRatio": 0.10
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Name": "City",
|
"Name": "City",
|
||||||
"VerBoundAnnotName": "CityLabel",
|
"VerBoundAnnotName": "CityLabel",
|
||||||
|
|||||||
@@ -3,19 +3,24 @@
|
|||||||
const signatures = []
|
const signatures = []
|
||||||
|
|
||||||
for (var element of document.elements) {
|
for (var element of document.elements) {
|
||||||
const [annotation, formField, annotation_date, formFieldDate, annotation_city, formFieldCity, annotation_date_label, formFieldDateLabel, annotation_city_label, formFieldCityLabel] = await Annotation.createSignature(element)
|
const [annotation, formField, annotation_date, formFieldDate, annotation_city, formFieldCity, annotation_position, formFieldPosition, annotation_date_label, formFieldDateLabel, annotation_city_label, formFieldCityLabel, annotation_position_label, formFieldPositionLabel] = await Annotation.createSignature(element)
|
||||||
signatures.push(annotation)
|
signatures.push(annotation)
|
||||||
signatures.push(formField)
|
signatures.push(formField)
|
||||||
signatures.push(annotation_date)
|
signatures.push(annotation_date)
|
||||||
signatures.push(formFieldDate)
|
signatures.push(formFieldDate)
|
||||||
signatures.push(annotation_city)
|
signatures.push(annotation_city)
|
||||||
signatures.push(formFieldCity)
|
signatures.push(formFieldCity)
|
||||||
|
signatures.push(annotation_position)
|
||||||
|
signatures.push(formFieldPosition)
|
||||||
|
|
||||||
signatures.push(annotation_date_label)
|
signatures.push(annotation_date_label)
|
||||||
signatures.push(formFieldDateLabel)
|
signatures.push(formFieldDateLabel)
|
||||||
|
|
||||||
signatures.push(annotation_city_label)
|
signatures.push(annotation_city_label)
|
||||||
signatures.push(formFieldCityLabel)
|
signatures.push(formFieldCityLabel)
|
||||||
|
|
||||||
|
signatures.push(annotation_position_label)
|
||||||
|
signatures.push(formFieldPositionLabel)
|
||||||
}
|
}
|
||||||
|
|
||||||
await instance.create(signatures)
|
await instance.create(signatures)
|
||||||
@@ -41,10 +46,24 @@
|
|||||||
annotationIds: PSPDFKit.Immutable.List([annotation.id]),
|
annotationIds: PSPDFKit.Immutable.List([annotation.id]),
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
//position
|
||||||
* Date, post code and place text form part
|
const id_position = PSPDFKit.generateInstantId()
|
||||||
*/
|
const annotation_position = new PSPDFKit.Annotations.WidgetAnnotation({
|
||||||
const date_place_top_shift = 9.5;
|
id: id_position,
|
||||||
|
pageIndex: page,
|
||||||
|
formFieldName: id_position,
|
||||||
|
backgroundColor: PSPDFKit.Color.DarkBlue,
|
||||||
|
blendMode: 'multiply',
|
||||||
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.position),
|
||||||
|
fontSize: 8
|
||||||
|
})
|
||||||
|
|
||||||
|
const formFieldPosition = new PSPDFKit.FormFields.TextFormField({
|
||||||
|
name: id_position,
|
||||||
|
annotationIds: PSPDFKit.Immutable.List([annotation_position.id]),
|
||||||
|
value: "",
|
||||||
|
readOnly: false
|
||||||
|
})
|
||||||
|
|
||||||
//city
|
//city
|
||||||
const id_city = PSPDFKit.generateInstantId()
|
const id_city = PSPDFKit.generateInstantId()
|
||||||
@@ -95,7 +114,6 @@
|
|||||||
/**
|
/**
|
||||||
* Date, post code and place label part
|
* Date, post code and place label part
|
||||||
*/
|
*/
|
||||||
const label_top_shift = -15
|
|
||||||
|
|
||||||
//date label
|
//date label
|
||||||
const id_date_label = PSPDFKit.generateInstantId()
|
const id_date_label = PSPDFKit.generateInstantId()
|
||||||
@@ -140,7 +158,28 @@
|
|||||||
readOnly: true
|
readOnly: true
|
||||||
})
|
})
|
||||||
|
|
||||||
return [annotation, formField, annotation_date, formFieldDate, annotation_city, formFieldCity, annotation_date_label, formFieldDateLabel, annotation_city_label, formFieldCityLabel]
|
//position label
|
||||||
|
const id_position_label = PSPDFKit.generateInstantId()
|
||||||
|
const annotation_position_label = new PSPDFKit.Annotations.WidgetAnnotation({
|
||||||
|
id: id_position_label,
|
||||||
|
pageIndex: page,
|
||||||
|
formFieldName: id_position_label,
|
||||||
|
blendMode: 'multiply',
|
||||||
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.positionlabel),
|
||||||
|
fontSize: 8,
|
||||||
|
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
||||||
|
fontColor: PSPDFKit.Color.Black,
|
||||||
|
isBold: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
const formFieldPositionLabel = new PSPDFKit.FormFields.TextFormField({
|
||||||
|
name: id_position_label,
|
||||||
|
annotationIds: PSPDFKit.Immutable.List([annotation_position_label.id]),
|
||||||
|
value: "Position",
|
||||||
|
readOnly: true
|
||||||
|
})
|
||||||
|
|
||||||
|
return [annotation, formField, annotation_date, formFieldDate, annotation_city, formFieldCity, annotation_position, formFieldPosition, annotation_date_label, formFieldDateLabel, annotation_city_label, formFieldCityLabel, annotation_position_label, formFieldPositionLabel]
|
||||||
}
|
}
|
||||||
|
|
||||||
static createTextBox(element) {
|
static createTextBox(element) {
|
||||||
|
|||||||
Reference in New Issue
Block a user