Dim caption As String = "Example: GetFormFieldFullTitle"
Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
If gdpicturePDF.LoadFromFile("forms.pdf", False) = GdPictureStatus.OK Then
Dim count As Integer = gdpicturePDF.GetFormFieldsCount()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
Dim formID As Integer = 0, cloneNr As Integer = 0
Dim message As String = "", fullTitle As String = "", withCloneNr As String = ""
Dim type As PdfFormFieldType = PdfFormFieldType.PdfFormFieldTypeUnknown
For i As Integer = 0 To count - 1
formID = gdpicturePDF.GetFormFieldId(i)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
type = gdpicturePDF.GetFormFieldType(formID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + "Field nr." + (i + 1).ToString() + ": type=" + type.ToString() + vbCrLf
fullTitle = gdpicturePDF.GetFormFieldFullTitle(formID)
message = message + " fullTitle="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + fullTitle
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
cloneNr = gdpicturePDF.GetFormFieldCloneNumber(formID)
message = message + "; cloneNr="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + cloneNr.ToString()
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
withCloneNr = gdpicturePDF.GetFormFieldFullTitle(formID)
message = message + "; titleWithCloneNr="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + withCloneNr
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + "The GetFormFieldType() method has failed with the status: " + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + "The GetFormFieldId() method has failed with the status: " + gdpicturePDF.GetStat().ToString()
Exit For
End If
message += vbCrLf
Next
If count = 0 Then MessageBox.Show("This file doesn't include forms.", caption) Else MessageBox.Show(message, caption)
Else
MessageBox.Show("The GetFormFieldsCount() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetFormFieldFullTitle";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("forms.pdf", false) == GdPictureStatus.OK)
{
int count = gdpicturePDF.GetFormFieldsCount();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
int formID = 0, cloneNr = 0;
string message = "", fullTitle = "", withCloneNr = "";
PdfFormFieldType type = PdfFormFieldType.PdfFormFieldTypeUnknown;
for (int i = 0; i < count; i++)
{
formID = gdpicturePDF.GetFormFieldId(i);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
type = gdpicturePDF.GetFormFieldType(formID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
message = message + "Field nr." + (i + 1).ToString() + ": type=" + type.ToString() + "\n";
fullTitle = gdpicturePDF.GetFormFieldFullTitle(formID);
message = message + " fullTitle=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + fullTitle;
else
message = message + gdpicturePDF.GetStat().ToString();
cloneNr = gdpicturePDF.GetFormFieldCloneNumber(formID);
message = message + "; cloneNr=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + cloneNr.ToString();
else
message = message + gdpicturePDF.GetStat().ToString();
withCloneNr = gdpicturePDF.GetFormFieldFullTitle(formID);
message = message + "; titleWithCloneNr=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + withCloneNr;
else
message = message + gdpicturePDF.GetStat().ToString();
}
else
message = message + "The GetFormFieldType() method has failed with the status: " + gdpicturePDF.GetStat().ToString();
}
else
{
message = message + "The GetFormFieldId() method has failed with the status: " + gdpicturePDF.GetStat().ToString();
break;
}
message += "\n";
}
if (count == 0)
MessageBox.Show("This file doesn't include forms.", caption);
else
MessageBox.Show(message, caption);
}
else
MessageBox.Show("The GetFormFieldsCount() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();