The Object property sets/gets reference of object to which the bookmark points. Object can be the reference to a text, image or any other PDF Creator object. When navigating to a bookmark, the page where the object is located is shown, and the object scrolled into view.
Public Property [Object]() As String
public string Object [ get, set ]
Member of Amyuni.PDFCreator.IacBookmark.
Object can be empty, in this case the bookmark points to the top of the current page.
Starting with PDF Creator version 2, Object can describe any action defined by the PDF specifications. The object property should contain in this case valid PDF syntax to indicate a PDF action. An example is given below.
System.IO.FileStream file1 = new System.IO.FileStream("Bookmark.pdf", FileMode.Open);
System.IO.FileStream file2 = new System.IO.FileStream("Bookmarked5.pdf", FileMode.Create);
IacDocument document = new IacDocument(null);
// open a PDF file containing a text object in it.
document.Open(file1, "");
// set a root bookmark to access the whole bookmark tree
Amyuni.PDFCreator.IacBookmark root = document.RootBookmark;
// insert a bookmark under the root
root.InsertChild(0, "bookmark1", "acText1");
MessageBox.Show("Bookmark 1 is pointing to" + root.GetChild(0).BookmarkObject);
// change the object that "bookmark1" is pointing to,
// from "acText1" to "acText4" on page 4
root.GetChild(0).BookmarkObject = "acText4";
MessageBox.Show("Bookmark 1 is now pointing to" + root.GetChild(0).BookmarkObject);
// insert another bookmark that points to our website
root.InsertChild(1, "Visit our web site", "/S /URI /URI (http://www.amyuni.com)");
document.Save(file2, Amyuni.PDFCreator.IacFileSaveOption.acFileSaveView);
root.Dispose();