Link and Bookmark Action List

Hi,

How to get the List of Actions (in case of Multiple Actions) for Links and bookmarks using Aspose.PDF.dll?

Please let me know.

Thanks in advance!

Hi Chenna,

Thanks for contacting support.

Do you need to get the Action associated with Link or Bookmark object ? If so is the case, please follow the instructions specified over

In case I have not properly understood your requirement, please share some further details.

Hi,

Here is what I am looking for:

In Adobe Acrobat, right-Click on the link/bookmark and select Properties. Then, click on the 'Actions' tab. There in the Actions frame, if multiple entries of Actions are present, then how can I read all those Actions using ASPOSE?

I have attached a document for your reference with an example. It is a single page, with single link and bookmark document. Both Link and bookmark are having multiple 'Actions' associated.

Thank you.


Hi Chenna,


Thanks for sharing the details.

We are working over this query and will get back to you soon.

Hi Chenna,


We are sorry for the delayed response. Please check following code snippets to check action list of a bookmark and Link Annotation. Hopefully it will help you to accomplish the task.

// Bookmarks<o:p></o:p>

Document doc = new Document(myDir+"LinkAction.pdf");

OutlineItemCollection bookmark = doc.Outlines[1]; // doc.Outlines.First

GoToAction goToAction = (GoToAction)bookmark.Action; // if bookmark is GoToAction

PdfAction bmaction = bookmark.Action;

Console.WriteLine((bmaction as GoToAction).Destination);

ActionCollection bmactions = bmaction.Next;

while (bmactions.Count > 0)

{

foreach (PdfAction action in bmactions)

{

Console.WriteLine((action as GoToURIAction).URI);

bmactions = action.Next;

}

}

// LinkAnnotation

Document doc = new Document(myDir+"LinkAction.pdf");

LinkAnnotation annot = doc66.Pages[1].Annotations[1] as LinkAnnotation;

PdfAction action = annot.Action;

Console.WriteLine((action as GoToAction).Destination);

ActionCollection actions = action.Next;

while (actions.Count > 0)

{

foreach (PdfAction action1 in actions)

{

Console.WriteLine((action1 as GoToURIAction).URI);

actions = action1.Next;

}

}

Please feel free to contact us for any further assistance.


Best Regards,