GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    Bookmark Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents the bookmark (pair of BookmarkStart and BookmarkEnd elements).

    • C#
    • VB.NET
    public sealed class Bookmark
    Public NotInheritable Class Bookmark
    Inheritance:
    System.Object
    Bookmark
    Remarks

    A Bookmark object serves as a façade for BookmarkStart and BookmarkEnd elements.

    Bookmark objects can be retrieved from Bookmarks collection. Bookmarks collection contains all bookmarks in the document. Use Bookmarks collection to retrieve a Bookmark with a specified name, iterate over all bookmarks or remove a bookmark.

    Bookmarks are usually used in a conjunction with Hyperlinks or Fields for navigating to a bookmarked part of the document or to render a page number (or some other information) of a bookmarked part of the document. For more information, see Bookmarks and Hyperlinks and Modify Bookmarks examples.

    Properties

    End

    Gets the BookmarkEnd element.

    • C#
    • VB.NET
    public BookmarkEnd End { get; }
    Public ReadOnly Property End As BookmarkEnd
    Property Value
    BookmarkEnd

    The BookmarkEnd element.

    Name

    Gets the bookmark name.

    • C#
    • VB.NET
    public string Name { get; }
    Public ReadOnly Property Name As String
    Property Value
    System.String

    The bookmark name.

    Start

    Gets the BookmarkStart element.

    • C#
    • VB.NET
    public BookmarkStart Start { get; }
    Public ReadOnly Property Start As BookmarkStart
    Property Value
    BookmarkStart

    The BookmarkStart element.

    Methods

    GetContent(Boolean)

    Gets the content of the current Bookmark.

    • C#
    • VB.NET
    public ContentRange GetContent(bool includeBookmarkStartEnd)
    Public Function GetContent(includeBookmarkStartEnd As Boolean) As ContentRange
    Parameters
    includeBookmarkStartEnd
    System.Boolean

    if set to true, returned ContentRange will also contain Start and End elements, otherwise it won't.

    Returns
    ContentRange

    The content of the current Bookmark.

    Remarks

    Following table explains how includeBookmarkStartEnd parameter value affects on the behavior of methods of the returned ContentRange:

    includeBookmarkStartEnd is falseincludeBookmarkStartEnd is true
    Delete() methodDeletes content between Start and End,
    leaving the Start and End in the document.
    Deletes content between Start and End,
    removing the Start and End from the document,
    thus removing the current Bookmark from the document (Bookmarks collection).
    LoadText(String) and Set(ContentRange) methodsSets new bookmarked content,
    leaving the Start and End in the document.
    Sets new bookmarked content,
    removing the Start and End from the document,
    thus removing the current Bookmark from the document (Bookmarks collection).

    For more information, see modify bookmarks example.

    See Also

    Bookmarks
    BookmarkStart
    BookmarkEnd
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.