A unique bookmark identifier specifying a required bookmark object.

You can obtain this identifier using these methods: GdPicturePDF.NewBookmark, GdPicturePDF.GetBookmarkRootID, GdPicturePDF.GetBookmarkFirstChildID, GdPicturePDF.GetBookmarkNextID, GdPicturePDF.GetBookmarkPrevID or GdPicturePDF.GetBookmarkParentID.

Example





In This Topic
GdPicture14 Namespace / GdPicturePDF Class / GetBookmarkActionID Method

GetBookmarkActionID Method (GdPicturePDF)

In This Topic
Returns the action's unique identifier of the action associated with a bookmark item specified by its unique identifier. You can subsequently use the GdPicturePDF.GetActionType method to determine the kind of this action.
Syntax
'Declaration

 

Public Function GetBookmarkActionID( _

   ByVal BookmarkID As Integer _

) As Integer
public int GetBookmarkActionID( 

   int BookmarkID

)
public function GetBookmarkActionID( 

    BookmarkID: Integer

): Integer; 
public function GetBookmarkActionID( 

   BookmarkID : int

) : int;
public: int GetBookmarkActionID( 

   int BookmarkID

) 
public:

int GetBookmarkActionID( 

   int BookmarkID

) 

Parameters

BookmarkID
A unique bookmark identifier specifying a required bookmark object.

You can obtain this identifier using these methods: GdPicturePDF.NewBookmark, GdPicturePDF.GetBookmarkRootID, GdPicturePDF.GetBookmarkFirstChildID, GdPicturePDF.GetBookmarkNextID, GdPicturePDF.GetBookmarkPrevID or GdPicturePDF.GetBookmarkParentID.

Return Value

A unique action identifier of the action associated with a specified bookmark. The GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.

You can use the GdPicturePDF.GetActionType method to obtain the type of this action, as it is shown in the example below.

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

It is recommend to use the GdPicturePDF.GetStat method to identify the specific reason for the method's failure, if any.

Example
How to find out if the root bookmark in the PDF document is associated with an action. The example shows you, how to determine the type of the associated action.
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();
See Also