From 66914712766b18be2542807c88b90a4e78c5ce4c Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 16 Sep 2025 17:37:20 +0200 Subject: [PATCH] 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. --- .../Jobs/FinalizeDocument/PDFBurner.vb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb index 13160837..b2b1157d 100644 --- a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb +++ b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb @@ -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)