Dim caption As String = "Example: MoveBookmarkUp"
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 bookmarkID As Integer = gdpicturePDF.GetBookmarkNextID(rootID)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
status = gdpicturePDF.MoveBookmarkUp(bookmarkID)
If status = GdPictureStatus.OK Then
status = gdpicturePDF.SaveToFile("bookmarks_MoveUp.pdf", False)
If status = GdPictureStatus.OK Then
MessageBox.Show("The example has been followed successfully.", caption)
Else
MessageBox.Show("The file can't be saved. Status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The MoveBookmarkUp() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The root bookmark has no next bookmark ready to move up or an error occurs.", caption)
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: MoveBookmarkUp";
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 bookmarkID = gdpicturePDF.GetBookmarkNextID(rootID);
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.MoveBookmarkUp(bookmarkID);
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.SaveToFile("bookmarks_MoveUp.pdf", false);
if (status == GdPictureStatus.OK)
MessageBox.Show("The example has been followed successfully.", caption);
else
MessageBox.Show("The file can't be saved. Status: " + status.ToString(), caption);
}
else
MessageBox.Show("The MoveBookmarkUp() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The root bookmark has no next bookmark ready to move up or an error occurs.", 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();