RemoveBookmarks Method (GdPicturePDF)
In This Topic
Removes all bookmark items (whole bookmark's hierarchy) from the currently loaded PDF document. The bookmark's section (known as "Outlines" entry) is also
removed from the document's catalog.
Syntax
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
Example
How to remove all bookmarks from the PDF document.
Dim caption As String = "Example: RemoveBookmarks"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("bookmarks.pdf", False) = GdPictureStatus.OK Then
Dim status As GdPictureStatus = gdpicturePDF.RemoveBookmarks()
MessageBox.Show("The example has been followed with the status: " + status.ToString(), caption)
If gdpicturePDF.SaveToFile("bookmarks_removed.pdf") <> GdPictureStatus.OK Then
MessageBox.Show("The file can't be saved.", caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: RemoveBookmarks";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("bookmarks.pdf", false) == GdPictureStatus.OK)
{
GdPictureStatus status = gdpicturePDF.RemoveBookmarks();
MessageBox.Show("The example has been followed with the status: " + status.ToString(), caption);
if (gdpicturePDF.SaveToFile("bookmarks_removed.pdf") != GdPictureStatus.OK)
MessageBox.Show("The file can't be saved.", caption);
}
else
{
MessageBox.Show("The file can't be loaded.", caption);
}
gdpicturePDF.Dispose();
Example
How to remove all bookmarks from the PDF document.
Dim caption As String = "Example: RemoveBookmarks"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("bookmarks.pdf", False) = GdPictureStatus.OK Then
Dim status As GdPictureStatus = gdpicturePDF.RemoveBookmarks()
MessageBox.Show("The example has been followed with the status: " + status.ToString(), caption)
If gdpicturePDF.SaveToFile("bookmarks_removed.pdf") <> GdPictureStatus.OK Then
MessageBox.Show("The file can't be saved.", caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: RemoveBookmarks";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("bookmarks.pdf", false) == GdPictureStatus.OK)
{
GdPictureStatus status = gdpicturePDF.RemoveBookmarks();
MessageBox.Show("The example has been followed with the status: " + status.ToString(), caption);
if (gdpicturePDF.SaveToFile("bookmarks_removed.pdf") != GdPictureStatus.OK)
MessageBox.Show("The file can't be saved.", caption);
}
else
{
MessageBox.Show("The file can't be loaded.", caption);
}
gdpicturePDF.Dispose();
See Also