GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / RemoveBookmarks Method
Example





In This Topic
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
'Declaration
 
Public Function RemoveBookmarks() As GdPictureStatus
public GdPictureStatus RemoveBookmarks()
public function RemoveBookmarks(): GdPictureStatus; 
public function RemoveBookmarks() : GdPictureStatus;
public: GdPictureStatus RemoveBookmarks(); 
public:
GdPictureStatus RemoveBookmarks(); 

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.

Remarks
This method is only allowed for use with non-encrypted documents.

The value of GdPictureStatus.OK is returned if the PDF document doesn't contain any bookmarks.

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