René Rakitow
2015-05-11 20:03:47 UTC
Hello,
Im trying to loop through the annotations of a pdf and find the name of it and its data
I have the following code;
Private Sub GetAnnots(PdfFile As String)
Dim PdfReader As New PdfReader(PdfFile)
Dim PageDictionary As PdfDictionary = Nothing
Dim AnnotArray As PdfArray = Nothing
Dim Annotation As PdfDictionary = Nothing
Dim PdfString As PdfString = Nothing
Dim AnnotationDictionary As PdfDictionary = Nothing
For page = 1 To PdfReader.NumberOfPages
PageDictionary = PdfReader.GetPageN(page)
AnnotArray = PageDictionary.GetAsArray(PdfName.ANNOTS)
If Not AnnotArray Is Nothing Then
For Each pdfobj As PdfObject In AnnotArray.ArrayList
AnnotationDictionary = DirectCast(PdfReader.GetPdfObject(pdfobj), PdfDictionary)
'' HOW do I go further?
Next
End If
Next
End Sub
Kind regards,
René
Im trying to loop through the annotations of a pdf and find the name of it and its data
I have the following code;
Private Sub GetAnnots(PdfFile As String)
Dim PdfReader As New PdfReader(PdfFile)
Dim PageDictionary As PdfDictionary = Nothing
Dim AnnotArray As PdfArray = Nothing
Dim Annotation As PdfDictionary = Nothing
Dim PdfString As PdfString = Nothing
Dim AnnotationDictionary As PdfDictionary = Nothing
For page = 1 To PdfReader.NumberOfPages
PageDictionary = PdfReader.GetPageN(page)
AnnotArray = PageDictionary.GetAsArray(PdfName.ANNOTS)
If Not AnnotArray Is Nothing Then
For Each pdfobj As PdfObject In AnnotArray.ArrayList
AnnotationDictionary = DirectCast(PdfReader.GetPdfObject(pdfobj), PdfDictionary)
'' HOW do I go further?
Next
End If
Next
End Sub
Kind regards,
René