fix(pdfburner): correct y-position adjustment for signature seal annotations

Previously, image annotations for signature seals used a static yOffset
when combined with ink annotations, which caused positioning issues.
This change calculates the y-position of the signature annotation
relative to the next annotation and applies it only for the first seal.

- Added `yPosOfSigAnnot` calculation for precise vertical placement.
- Updated `AddInstantJSONAnnotationToPDF` to overwrite bbox.y for seals.
- Removed hardcoded ink offset logic.
This commit is contained in:
tekh 2025-09-16 17:37:20 +02:00
parent b2bfc11713
commit 6691471276

View File

@ -71,6 +71,7 @@ Namespace Jobs.FinalizeDocument
oAnnotationData.annotations.Reverse()
Dim sigAnnotType = oAnnotationData.annotations.ElementAt(1).type
Dim yPosOfSigAnnot = oAnnotationData.annotations.ElementAt(2).bbox.ElementAt(1) - 71.84002685546875 + 7
Dim isSeal = True 'First element is signature seal
Dim formFieldIndex = 0
@ -79,9 +80,12 @@ Namespace Jobs.FinalizeDocument
Select Case oAnnotation.type
Case ANNOTATION_TYPE_IMAGE
'Add offset to solve the seal position problem in ink signatures
Dim yOffset As Double = If(isSeal And sigAnnotType = ANNOTATION_TYPE_INK, 0.07, 0)
AddImageAnnotation(oAnnotation, oAnnotationData.attachments, yOffset)
If (isSeal) Then
oAnnotation.bbox.Item(1) = yPosOfSigAnnot
End If
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
Case ANNOTATION_TYPE_INK
AddInkAnnotation(oAnnotation)