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

    Show / Hide Table of Contents

    Hyperlink Class

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

    Represents an Inline that can be used to create a link to an external resource or to a Bookmark inside a document.

    • C#
    • VB.NET
    public sealed class Hyperlink : Inline, IContentElement
    Public NotInheritable Class Hyperlink
        Inherits Inline
        Implements IContentElement
    Inheritance:
    System.Object
    Element
    Inline
    Hyperlink
    Implements
    IContentElement
    Remarks

    Hyperlink is an Inline element. For more information about GemBox.Document Content Model, see content model.

    Hyperlink can contain any other Inline element except Hyperlink in its DisplayInlines content property.

    For an example how to create a Hyperlink to a Bookmark, see Bookmarks and Hyperlinks example.

    Hyperlinks exported to XPS file format do not provide navigational capabilities.

    Constructors

    Hyperlink(DocumentModel, String, Inline[])

    Initializes a new instance of the Hyperlink class.

    • C#
    • VB.NET
    public Hyperlink(DocumentModel document, string address, params Inline[] displayInlines)
    Public Sub New(document As DocumentModel, address As String, ParamArray displayInlines As Inline())
    Parameters
    document
    DocumentModel

    The owner document.

    address
    System.String

    The address that identifies external resource such as URL, or bookmark name.

    displayInlines
    Inline[]

    The Inline sequence that represents hyperlink display elements.

    Hyperlink(DocumentModel, String, IEnumerable<Inline>)

    Initializes a new instance of the Hyperlink class.

    • C#
    • VB.NET
    public Hyperlink(DocumentModel document, string address, IEnumerable<Inline> displayInlines)
    Public Sub New(document As DocumentModel, address As String, displayInlines As IEnumerable(Of Inline))
    Parameters
    document
    DocumentModel

    The owner document.

    address
    System.String

    The address that identifies external resource such as URL, or bookmark name.

    displayInlines
    System.Collections.Generic.IEnumerable<Inline>

    The Inline sequence that represents hyperlink display elements.

    Hyperlink(DocumentModel, String, String)

    Initializes a new instance of the Hyperlink class.

    • C#
    • VB.NET
    public Hyperlink(DocumentModel document, string address, string displayText)
    Public Sub New(document As DocumentModel, address As String, displayText As String)
    Parameters
    document
    DocumentModel

    The owner document.

    address
    System.String

    The address that identifies external resource such as URL, or bookmark name.

    displayText
    System.String

    The hyperlink display text.

    Properties

    Address

    Gets or sets the hyperlink address.

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

    The hyperlink address.

    Remarks

    Can contain an URI string or a Bookmark name.

    DisplayInlines

    Gets the hyperlink display Inlines.

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

    The hyperlink display Inlines.

    Remarks

    All Inline derived elements except Hyperlink are supported in this collection.

    ElementType

    Gets the ElementType of this Element instance.

    • C#
    • VB.NET
    public override ElementType ElementType { get; }
    Public Overrides ReadOnly Property ElementType As ElementType
    Property Value
    ElementType

    The ElementType of this Element instance.

    Overrides
    Element.ElementType

    IsBookmarkLink

    Gets or sets a value indicating whether this Hyperlink instance is bookmark link.

    • C#
    • VB.NET
    public bool IsBookmarkLink { get; set; }
    Public Property IsBookmarkLink As Boolean
    Property Value
    System.Boolean

    true if this Hyperlink instance is bookmark link; otherwise, false.

    ScreenTip

    Gets or sets the screen tip.

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

    The screen tip.

    TargetFrame

    Gets or sets the target frame.

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

    The target frame.

    Remarks

    Supported values are: _blank, _parent, _self, _top or frame name.

    Methods

    Clone(Boolean)

    Clones this Hyperlink instance, and optionally clones it's display elements.

    • C#
    • VB.NET
    public Hyperlink Clone(bool cloneDisplay)
    Public Function Clone(cloneDisplay As Boolean) As Hyperlink
    Parameters
    cloneDisplay
    System.Boolean

    true to clone hyperlink display elements; otherwise false.

    Returns
    Hyperlink

    Cloned Hyperlink.

    Remarks

    Document content element instance can exist only in a one place in the document.

    If you want to insert document content element into some other part of the same document, then clone the element and insert its clone.

    If you want to insert document content element into another document, then you should first import it into another document with Import<T>(T, Boolean, Boolean) method and then insert the imported element.

    For more information, see cloning example.

    CreateHyperlinkStyledRun(DocumentModel, String)

    Creates the hyperlink-styled Run.

    • C#
    • VB.NET
    public static Run CreateHyperlinkStyledRun(DocumentModel document, string text)
    Public Shared Function CreateHyperlinkStyledRun(document As DocumentModel, text As String) As Run
    Parameters
    document
    DocumentModel

    The owner document.

    text
    System.String

    The run text.

    Returns
    Run

    The hyperlink-styled Run.

    Inherited Properties

    Content

    Gets the content of the current Element.

    (Inherited from Element)

    Document

    Gets the owner document.

    (Inherited from Element)

    Parent

    Gets the parent of this Element instance.

    (Inherited from Element)

    ParentCollection

    Gets the InlineCollection that contains this Inline instance.

    (Inherited from Inline)

    Revision

    Gets or sets the revision information for the inline.

    (Inherited from Inline)

    Inherited Methods

    GetChildElements(System.Boolean)

    Gets the child elements.

    (Inherited from Element)

    GetChildElements(System.Boolean, ElementType[])

    Gets the child elements filtered by ElementType.

    (Inherited from Element)

    GetParentElements()

    Gets the parent elements.

    (Inherited from Element)

    GetParentElements(ElementType[])

    Gets the parent elements.

    (Inherited from Element)

    Implements

    IContentElement
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.