From 59105caffca69ed3368109ad701f7e321e46e026 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 5 Sep 2025 13:25:25 +0200 Subject: [PATCH] =?UTF-8?q?fix(pdf-burner):=20Korrektur=20des=20Versatzes?= =?UTF-8?q?=20von=20Siegelbildern=20f=C3=BCr=20Tintenunterschriften?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hinzufügen des Parameters „yOffset“ zu „AddImageAnnotation“, um die Position der Siegel anzupassen. - Aktualisierung von „AddInstantJSONAnnotationToPDF“, um den Versatz für das erste Unterschriftssiegel anzuwenden. - Stellt sicher, dass Tintenunterschriftssiegel in PDF-Dateien korrekt dargestellt werden, ohne andere Anmerkungen zu beeinträchtigen. --- .../Jobs/FinalizeDocument/PDFBurner.vb | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb index 21ac1629..0c4e1ea7 100644 --- a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb +++ b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb @@ -70,21 +70,18 @@ Namespace Jobs.FinalizeDocument Dim oAnnotationData = JsonConvert.DeserializeObject(Of AnnotationData)(pInstantJSON) oAnnotationData.annotations.Reverse() - Dim annotCountPerSign = 5 - Dim annotIndex = 1 - Dim calcSignIndex = Function() CInt(Math.Ceiling(CDbl(annotIndex) / CDbl(annotCountPerSign))) - Dim calcAnnotIndexInSign = Function() (annotIndex - 1) Mod annotCountPerSign + 1 + Dim sigAnnotType = oAnnotationData.annotations.ElementAt(1).type + Dim isSeal = True 'First element is signature seal Dim formFieldIndex = 0 For Each oAnnotation In oAnnotationData.annotations Logger.Debug("Adding AnnotationID: " + oAnnotation.id) - Dim signIndex = calcSignIndex() - Dim annotIndexInSign = calcAnnotIndexInSign() - Select Case oAnnotation.type Case ANNOTATION_TYPE_IMAGE - AddImageAnnotation(oAnnotation, oAnnotationData.attachments) + 'Add offset to solve the seal position problem in ink signatures + Dim yOffset As Double = If(isSeal And sigAnnotType = ANNOTATION_TYPE_INK, 0.16, 0) + AddImageAnnotation(oAnnotation, oAnnotationData.attachments, yOffset) Case ANNOTATION_TYPE_INK AddInkAnnotation(oAnnotation) @@ -98,7 +95,7 @@ Namespace Jobs.FinalizeDocument End If End Select - annotIndex += 1 + isSeal = False Next Return True @@ -109,7 +106,7 @@ Namespace Jobs.FinalizeDocument End Try End Function - Private Function AddImageAnnotation(pAnnotation As Annotation, pAttachments As Dictionary(Of String, Attachment)) As Boolean + Private Function AddImageAnnotation(pAnnotation As Annotation, pAttachments As Dictionary(Of String, Attachment), Optional yOffset As Double = 0) As Boolean Try Dim oAttachment = pAttachments.Where(Function(a) a.Key = pAnnotation.imageAttachmentId). SingleOrDefault() @@ -118,7 +115,7 @@ Namespace Jobs.FinalizeDocument Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList() Dim oX = oBounds.Item(0) - Dim oY = oBounds.Item(1) + Dim oY = oBounds.Item(1) + yOffset Dim oWidth = oBounds.Item(2) Dim oHeight = oBounds.Item(3)