Dim caption As String = "Example: GetFormFieldActionID"
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 message As String = ""
Dim formID As Integer = 0, actionID As Integer = -1
Dim type As PdfFormFieldType = PdfFormFieldType.PdfFormFieldTypeUnknown
Dim actionType As PdfActionType = PdfActionType.ActionTypeUnknown
For i As Integer = 0 To count - 1
formID = gdpicturePDF.GetFormFieldId(i)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + (i + 1).ToString() + ".field's type: "
type = gdpicturePDF.GetFormFieldType(formID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + type + " action: "
actionID = gdpicturePDF.GetFormFieldActionID(formID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
actionType = gdpicturePDF.GetActionType(actionID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + actionType.ToString()
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
message = message + vbCrLf
Else
message = message + "The GetFormFieldId() method has failed with the status: " + gdpicturePDF.GetStat().ToString()
Exit For
End If
Next
If count = 0 Then message = "This file doesn't include forms."
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: GetFormFieldActionID";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("forms.pdf", false) == GdPictureStatus.OK)
{
int count = gdpicturePDF.GetFormFieldsCount();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
string message = "";
int formID = 0, actionID = -1;
PdfFormFieldType type = PdfFormFieldType.PdfFormFieldTypeUnknown;
PdfActionType actionType = PdfActionType.ActionTypeUnknown;
for (int i = 0; i < count; i++)
{
formID = gdpicturePDF.GetFormFieldId(i);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
message = message + (i + 1).ToString() + ".field's type: ";
type = gdpicturePDF.GetFormFieldType(formID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
message = message + type + " action: ";
actionID = gdpicturePDF.GetFormFieldActionID(formID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
actionType = gdpicturePDF.GetActionType(actionID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + actionType.ToString();
else
message = message + gdpicturePDF.GetStat().ToString();
}
else
message = message + gdpicturePDF.GetStat().ToString();
}
else
message = message + gdpicturePDF.GetStat().ToString();
message = message + "\n";
}
else
{
message = message + "The GetFormFieldId() method has failed with the status: " + gdpicturePDF.GetStat().ToString();
break;
}
}
if (count == 0) message = "This file doesn't include forms.";
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();