How do I set bookmark URL link?

Q: I need to create a Bookmark within a PDF to open a web link. We
have created prototype documents with Adobe Pro, and now I need to add
these links within the code.
I'm having trouble finding out how you do this. After searching on
Forum group I tried...

Bookmark linkBookmark = item.AddChild("Link");
pdftron.SDF.Obj a = doc.CreateIndirectDict();
a.Put("S", pdftron.SDF.Obj.CreateName("URI"));
a.Put("URI", pdftron.SDF.Obj.CreateString(link));
linkBookmark.SetAction(new Action(a));

But this gives a compile error saying it's not a valid method.

A: The code snippet is using some of the API-s that were deprecated
in PDFNet v4 (please see
The following is the updated code snippet:

Bookmark linkBookmark = bookmark_item.AddChild("Link");
pdftron.SDF.Obj a = doc.CreateIndirectDict(); // Create Action object
a.PutName("S", "URI");
a.PutString("URI", "");
linkBookmark.SetAction(new Action(a));

For a short description of how to upgrade old code, please see