refactor: add AddImageAnnotation-method

This commit is contained in:
tekh 2025-10-28 09:43:43 +01:00
parent fee256a51a
commit 7f9125b3aa

View File

@ -62,6 +62,8 @@ Namespace Jobs.FinalizeDocument
For Each annot In element.Annotations
If annot.Type = AnnotationType.FormField Then
AddFormFieldValue(annot.Name, x, y, 100, 180, element.Page, annot.Value)
ElseIf annot.Type = AnnotationType.FormField Then
AddImageAnnotation(x, y, 100, 180, element.Page, annot.Value)
End If
Next
Next
@ -135,6 +137,11 @@ Namespace Jobs.FinalizeDocument
End Sub
Private Sub AddImageAnnotation(x As Double, y As Double, width As Double, height As Double, page As Integer, base64 As String)
Manager.SelectPage(page + 1)
Manager.AddEmbeddedImageAnnotFromBase64(base64, x, y, width, height)
End Sub
Private Sub AddImageAnnotation(pAnnotation As Annotation, pAttachments As Dictionary(Of String, Attachment))
Dim oAttachment = pAttachments.Where(Function(a) a.Key = pAnnotation.imageAttachmentId).
SingleOrDefault()