Dim caption As String = "Example: GetBookmarkActionID"
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("bookmarks.pdf", False)
If status = GdPictureStatus.OK Then
Dim rootID As Integer = gdpicturePDF.GetBookmarkRootID()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
Dim actionID As Integer = gdpicturePDF.GetBookmarkActionID(rootID)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
Dim actionType As PdfActionType = gdpicturePDF.GetActionType(actionID)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The action associated with a root bookmark is of the type: " + actionType.ToString(), caption)
Else
MessageBox.Show("The GetActionType() method has failed with the status: " + status.ToString(), caption)
End If
Else
If status = GdPictureStatus.PropertyNotFound Then
MessageBox.Show("No action is associated with a root bookmark.", caption)
Else
MessageBox.Show("The GetBookmarkActionID() method has failed with the status: " + status.ToString(), caption)
End If
End If
Else
If status = GdPictureStatus.PropertyNotFound Then
MessageBox.Show("This PDF document doesn't contain any bookmarks.", caption)
Else
MessageBox.Show("The GetBookmarkRootID() method has failed with the status: " + status.ToString(), caption)
End If
End If
Else
MessageBox.Show("The file can't be loaded. Status: " + status.ToString(), caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetBookmarkActionID";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("bookmarks.pdf", false);
if (status == GdPictureStatus.OK)
{
int rootID = gdpicturePDF.GetBookmarkRootID();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
int actionID = gdpicturePDF.GetBookmarkActionID(rootID);
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
PdfActionType actionType = gdpicturePDF.GetActionType(actionID);
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("The action associated with a root bookmark is of the type: " + actionType.ToString(), caption);
else
MessageBox.Show("The GetActionType() method has failed with the status: " + status.ToString(), caption);
}
else
{
if (status == GdPictureStatus.PropertyNotFound)
MessageBox.Show("No action is associated with a root bookmark.", caption);
else
MessageBox.Show("The GetBookmarkActionID() method has failed with the status: " + status.ToString(), caption);
}
}
else
{
if (status == GdPictureStatus.PropertyNotFound)
MessageBox.Show("This PDF document doesn't contain any bookmarks.", caption);
else
MessageBox.Show("The GetBookmarkRootID() method has failed with the status: " + status.ToString(), caption);
}
}
else
{
MessageBox.Show("The file can't be loaded. Status: " + status.ToString(), caption);
}
gdpicturePDF.Dispose();