We go through each item. We check to see if it is an annotation.
If it is we check to see if the annotation type is text. If we have
found a text annotation we extract the content and add the value to
our list.
// extract annotation values (for insertion into PDF)
for (int i = 0; i <= lastID; i++) {
string theType = fdf.GetInfo(i, "Type");
if (theType == "anno") {
if (fdf.GetInfo(i, "SubType") == "Text") {
string theCont;
theCont = fdf.GetInfo(i, "Contents");
theValues = theValues + theCont + "\r\n\r\n";
}
}
}
// extract field values (for demonstration purposes)
for (int i = 0; i <= lastID; i++) {
int theN = fdf.GetInfoInt(i, "/FDF*/Fields*:Count");
for (int j = 0; j < theN; j++) {
string name = fdf.GetInfo(i, "/FDF*/Fields*[" + j + "]*/T:Text");
string value = fdf.GetInfo(i, "/FDF*/Fields*[" + j + "]*/V:Text");
// here we would do something with the field value we've found
}
}
' extract annotation values (for insertion into PDF)
Dim i As Integer = 0
While i <= theLastID
Dim theType As String = theFDF.GetInfo(i, "Type")
If theType = "anno" Then
If theFDF.GetInfo(i, "SubType") = "Text" Then
Dim theCont As String
theCont = theFDF.GetInfo(i, "Contents")
theValues = theValues + theCont + vbCr & vbLf & vbCr & vbLf
End If
End If
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
' extract field values (for demonstration purposes)
Dim i As Integer = 0
While i <= theLastID
Dim [theN] As Integer = theFDF.GetInfoInt(i, "/FDF*/Fields*:Count")
Dim j As Integer = 0
While j < [theN]
Dim theName As String = theFDF.GetInfo(i, "/FDF*/Fields*[" + j + "]*/T:Text")
' here we would do something with the field value we've found
Dim theValue As String = theFDF.GetInfo(i, "/FDF*/Fields*[" + j + "]*/V:Text")
System.Math.Max(System.Threading.Interlocked.Increment(j),j - 1)
End While
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While