|
Adds a bookmark which points to the current page.
Bookmarks are specified as paths in much the same way as file
paths. Headings and subheadings are separated by a backslash
character. For example:
"1. Introduction\1.1 Aim and Methods\1.1.3
Diagrams"
When a bookmark is added, intermediate headings and subheadings
will be created if they do not already exist.
To add multiple bookmarks all referring to the same page simply
call the AddBookmark function multiple times.
This function returns the Object ID of the newly added Bookmark
Object.
|
Hyperlinks. Sometimes you may wish to insert bookmarks
which link to an external web page specified using a URI or URL.
You can do this using hyperlink code of the following form. Please
do ensure that your URLs come from trusted sources only. You do not
want to be in a situation in which people can add links to malware
or other dubious locations.
static int AddBookmarkToUri(Doc doc, string bookmark, string uri) {
int id = doc.AddBookmark(bookmark, true);
doc.SetInfo(id, "/Dest:Del", ""); // remove link to page and add link to url
doc.SetInfo(id, "/A", "<< /Type /Action /S /URI /URI () >>");
doc.SetInfo(id, "/A/URI:Text", uri);
return id;
}
Private Shared Function AddBookmarkToUri(ByVal doc As Doc, ByVal bookmark As String, ByVal uri As String) As Integer
Dim id As Integer = doc.AddBookmark(bookmark, True)
doc.SetInfo(id, "/Dest:Del", "", "") ' remove link to page and add link to url
doc.SetInfo(id, "/A", "<< /Type /Action /S /URI /URI () >>")
doc.SetInfo(id, "/A/URI:Text", uri)
Return id
End Function
|
|
|
|