Dim caption As String = "Example: GetActionURI"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("forms_actions.pdf", False) = GdPictureStatus.OK Then
Dim FormsCount As Integer = gdpicturePDF.GetFormFieldsCount()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status <> GdPictureStatus.OK OrElse FormsCount = 0 Then
MessageBox.Show("The GetFormFieldsCount() method has failed or " + vbCrLf + " this PDF document doesn't include any form fields.", caption)
Else
Dim ActionsURI As String = ""
For x As Integer = 0 To FormsCount - 1
Dim FFId As Integer = gdpicturePDF.GetFormFieldId(x)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
Dim ActionId As Integer = gdpicturePDF.GetFormFieldActionID(FFId)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
Dim ActionType As PdfActionType = gdpicturePDF.GetActionType(ActionId)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
If ActionType = PdfActionType.ActionTypeURI Then
Dim URI As String = gdpicturePDF.GetActionURI(ActionId)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
ActionsURI = ActionsURI + "Form Field Nr." + (x + 1).ToString() + " has associated URI action with URI = " + URI + vbCrLf
Else
ActionsURI = ActionsURI + "Form Field Nr." + (x + 1).ToString() + " has associated URI action, but the GetActionURI() method has failed with the status: " + status.ToString() + vbCrLf
End If
End If
End If
End If
End If
Next
MessageBox.Show(ActionsURI, caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetActionURI";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("forms_actions.pdf", false) == GdPictureStatus.OK)
{
int FormsCount = gdpicturePDF.GetFormFieldsCount();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status != GdPictureStatus.OK || FormsCount == 0)
{
MessageBox.Show("The GetFormFieldsCount() method has failed or \n this PDF document doesn't include any form fields.", caption);
}
else
{
string ActionsURI = "";
for (int x = 0; x <= FormsCount - 1; x++)
{
int FFId = gdpicturePDF.GetFormFieldId(x);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
int ActionId = gdpicturePDF.GetFormFieldActionID(FFId);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
PdfActionType ActionType = gdpicturePDF.GetActionType(ActionId);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
if (ActionType == PdfActionType.ActionTypeURI)
{
string URI = gdpicturePDF.GetActionURI(ActionId);
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
ActionsURI = ActionsURI + "Form Field Nr." + (x + 1).ToString() + " has associated URI action with URI = " + URI + "\n";
}
else
{
ActionsURI = ActionsURI + "Form Field Nr." + (x + 1).ToString() + " has associated URI action, but the GetActionURI() method has failed with the status: " + status.ToString() + "\n";
}
}
}
}
}
}
MessageBox.Show(ActionsURI, caption);
}
}
else
{
MessageBox.Show("The file can't be loaded.", caption);
}
gdpicturePDF.Dispose();