PdfLoadedInkAnnotation inkAnnotation = loadedDocument.Pages[0].Annotations[0] as PdfLoadedInkAnnotation;
//Returns single ink list collection
List<float> list = inkAnnotation.InkList;
// Returns multiple ink list collection if present in the ink annotation
List<List<float>> listCollection = inkAnnotation.InkPointsCollection; |
If DirectCast(loadedPage, Syncfusion.Pdf.PdfPageBase).Annotations.Count > 0 Then
Dim unitConvertor As PdfUnitConvertor = New PdfUnitConvertor()
For Each a As Object In DirectCast(loadedPage, Syncfusion.Pdf.PdfPageBase).Annotations
If TypeOf a Is Syncfusion.Pdf.Interactive.PdfInkAnnotation Then
Dim an As Syncfusion.Pdf.Interactive.PdfInkAnnotation = DirectCast(a, Syncfusion.Pdf.Interactive.PdfInkAnnotation)
cb.SetColorStroke(New iTextSharp.text.BaseColor(an.Color.R, an.Color.G, an.Color.B))
If an.InkPointsCollection.FirstOrDefault IsNot Nothing Then
cb.MoveTo(an.InkPointsCollection(0)(0), an.InkPointsCollection(0)(1))
For i As Integer = 0 To an.InkPointsCollection(0).Count - 1 Step 2
Dim NextX As Single = an.InkPointsCollection(0)(i)
Dim NextY As Single = an.InkPointsCollection(0)(i + 1)
cb.LineTo(NextX + 1, NextY + 1)
cb.Stroke()
cb.MoveTo(NextX + 1, NextY + 1)
Next
End If |
If DirectCast(loadedPage, Syncfusion.Pdf.PdfPageBase).Annotations.Count > 0 Then
Dim unitConvertor As PdfUnitConvertor = New PdfUnitConvertor()
For Each a As Object In DirectCast(loadedPage, Syncfusion.Pdf.PdfPageBase).Annotations
If TypeOf a Is Syncfusion.Pdf.Interactive.PdfInkAnnotation Then
Dim an As Syncfusion.Pdf.Interactive.PdfInkAnnotation = DirectCast(a, Syncfusion.Pdf.Interactive.PdfInkAnnotation)
cb.SetColorStroke(New iTextSharp.text.BaseColor(an.Color.R, an.Color.G, an.Color.B))
If an.InkPointsCollection.FirstOrDefault IsNot Nothing Then
cb.MoveTo(unitConvertor.ConvertToPixels(an.InkPointsCollection(0)(0), PdfGraphicsUnit.Point), unitConvertor.ConvertToPixels(an.InkPointsCollection(0)(1), PdfGraphicsUnit.Point))
For i As Integer = 0 To an.InkPointsCollection(0).Count - 1 Step 2
Dim NextX As Single = unitConvertor.ConvertToPixels(an.InkPointsCollection(0)(i), PdfGraphicsUnit.Point)
Dim NextY As Single = unitConvertor.ConvertToPixels(an.InkPointsCollection(0)(i + 1), PdfGraphicsUnit.Point)
cb.LineTo(NextX + 1, NextY + 1)
cb.Stroke()
cb.MoveTo(NextX + 1, NextY + 1)
Next
End If |