diff --git a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb index e6c5fed2..23d2aa4b 100644 --- a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb +++ b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb @@ -64,6 +64,8 @@ Namespace Jobs.FinalizeDocument 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) + ElseIf annot.Type = AnnotationType.Ink Then + AddInkAnnotation(element.Page, annot.Value) End If Next Next @@ -158,6 +160,23 @@ Namespace Jobs.FinalizeDocument Manager.AddEmbeddedImageAnnotFromBase64(oAttachment.Value.binary, oX, oY, oWidth, oHeight) End Sub + Private Sub AddInkAnnotation(page As Integer, value As String) + + Dim ink = JsonConvert.DeserializeObject(Of Ink)(value) + + Dim oSegments = ink.lines.points + Dim oColor = ColorTranslator.FromHtml(ink.strokeColor) + Manager.SelectPage(page + 1) + + For Each oSegment As List(Of List(Of Single)) In oSegments + Dim oPoints = oSegment. + Select(AddressOf ToPointF). + ToArray() + + Manager.AddFreeHandAnnot(oColor, oPoints) + Next + End Sub + Private Sub AddInkAnnotation(pAnnotation As Annotation) Dim oSegments = pAnnotation.lines.points Dim oColor = ColorTranslator.FromHtml(pAnnotation.strokeColor) @@ -339,6 +358,12 @@ Namespace Jobs.FinalizeDocument Public Property strokeColor As String End Class + Friend Class Ink + Public Property lines As Lines + + Public Property strokeColor As String + End Class + Public Class EGName Public Shared ReadOnly NoName As String = Guid.NewGuid().ToString()