refactor(network): Die Methode getAnnotationParams wurde aktualisiert, um die Anmerkung übersetzen und das Verhältnis ihrer Größe ändern zu können.

This commit is contained in:
Developer 02
2025-03-24 10:24:35 +01:00
parent eef6bf27f1
commit 9ae1efb946
3 changed files with 19 additions and 13 deletions

View File

@@ -22,11 +22,12 @@
}
static async createSignature(element) {
const annotParams = await getAnnotationParams(element.left, element.top);
const id = PSPDFKit.generateInstantId()
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 width = annotParams.signature.width;
const height = annotParams.signature.height;
const top = annotParams.signature.top;
const left = annotParams.signature.left;
const page = element.page - 1
//signatures
@@ -36,12 +37,7 @@
formFieldName: id,
backgroundColor: PSPDFKit.Color.YELLOW,
blendMode: 'multiply',
boundingBox: new PSPDFKit.Geometry.Rect({
width,
height,
top,
left,
}),
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.signature),
})
const formField = new PSPDFKit.FormFields.SignatureFormField({