Dim caption As String = "Example: GetViewerOpenActionID"
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("actions.pdf", False)
If status = GdPictureStatus.OK Then
Dim actionID As Integer = gdpicturePDF.GetViewerOpenActionID()
status = gdpicturePDF.GetStat()
Select Case status
Case GdPictureStatus.OK
Dim actionType As PdfActionType = gdpicturePDF.GetActionType(actionID)
Dim status1 As GdPictureStatus = gdpicturePDF.GetStat()
If status1 = GdPictureStatus.OK Then
MessageBox.Show("The OpenAction action of the type " + actionType.ToString() + " is defined for this document.", caption)
Else
MessageBox.Show("The OpenAction action is defined for this document, but the GetActionType() method has failed with the status: " + status1.ToString(), caption)
End If
Exit Select
Case GdPictureStatus.PropertyNotFound
MessageBox.Show("The OpenAction action is not defined for this document.", caption)
Exit Select
Case Else
MessageBox.Show("The GetViewerOpenActionID() method has failed with the status: " + status.ToString(), caption)
Exit Select
End Select
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetViewerOpenActionID";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("actions.pdf", false);
if (status == GdPictureStatus.OK)
{
int actionID = gdpicturePDF.GetViewerOpenActionID();
status = gdpicturePDF.GetStat();
switch (status)
{
case GdPictureStatus.OK:
PdfActionType actionType = gdpicturePDF.GetActionType(actionID);
GdPictureStatus status1 = gdpicturePDF.GetStat();
if (status1 == GdPictureStatus.OK)
MessageBox.Show("The OpenAction action of the type " + actionType.ToString() + " is defined for this document.", caption);
else
MessageBox.Show("The OpenAction action is defined for this document, but the GetActionType() method has failed with the status: " + status1.ToString(), caption);
break;
case GdPictureStatus.PropertyNotFound:
MessageBox.Show("The OpenAction action is not defined for this document.", caption);
break;
default:
MessageBox.Show("The GetViewerOpenActionID() method has failed with the status: " + status.ToString(), caption);
break;
}
}
else
{
MessageBox.Show("The file can't be loaded.", caption);
}
gdpicturePDF.Dispose();