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.
[C#]
// extract annotation values (for insertion into PDF)
for (int i = 0; i <= theLastID; i++) {
string theType = theFDF.GetInfo(i, "Type");
if (theType == "anno") {
if (theFDF.GetInfo(i, "SubType") == "Text") {
string theCont;
theCont = theFDF.GetInfo(i, "Contents");
theValues = theValues + theCont + "\r\n\r\n";
}
}
}
// extract field values (for demonstration purposes)
for (int i = 0; i <= theLastID; i++) {
int theN = theFDF.GetInfoInt(i, "/FDF*/Fields*:Count");
for (int j = 0; j < theN; j++) {
string theName = theFDF.GetInfo(i, "/FDF*/Fields*[" + j + "]*/T:Text");
string theValue = theFDF.GetInfo(i, "/FDF*/Fields*[" + j + "]*/V:Text");
// here we would do something with the field value we've found
}
}
[Visual Basic]
' extract annotation values (for insertion into PDF)
For i As Integer = 0 To 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 & vbCrLf & vbCrLf
End If
End If
Next i
' extract field values (for demonstration purposes)
For i As Integer = 0 To theLastID
Dim [theN] As Integer = theFDF.GetInfoInt(i, "/FDF*/Fields*:Count")
For j As Integer = 0 To [theN] - 1
Dim theName As String = theFDF.GetInfo(i, "/FDF*/Fields*[" & j & "]*/T:Text")
Dim theValue As String = theFDF.GetInfo(i, "/FDF*/Fields*[" & j & "]*/V:Text")
' here we would do something with the field value we've found
Next j
Next i
|
|
|