Table of Contents

Class Hyperlink

Namespace
MigraDoc.DocumentObjectModel
Assembly
MigraDoc.DocumentObjectModel.dll

A Hyperlink is used to reference targets in the document (Local), on a drive (File) or a network (Web).

public class Hyperlink : DocumentObject
Inheritance
object
Hyperlink
Inherited Members
Extension Methods

Constructors

Hyperlink()

Initializes a new instance of the Hyperlink class.

Properties

BookmarkName

Gets or sets the target bookmark name of the Hyperlink. Used for HyperlinkTypes ExternalBookmark and Bookmark.

Elements

Gets the ParagraphElements of the Hyperlink specifying its 'clickable area'.

Filename

Gets or sets the target filename of the Hyperlink, e.g. a path to a file or an URL. Used for HyperlinkTypes ExternalBookmark, File and Url/Web.

Font

Gets or sets the font object.

Name

For HyperlinkType Local/Bookmark: Gets or sets the target bookmark name of the Hyperlink. For HyperlinkTypes File and Url/Web: Gets or sets the target filename of the Hyperlink, e.g. a path to a file or an URL. For HyperlinkType ExternalBookmark: Not valid - throws Exception. This property is retained due to compatibility reasons.

NewWindow

Defines if the HyperlinkType ExternalBookmark shall be opened in a new window. If not set, the viewer application should behave in accordance with the current user preference.

NoHyperlinkStyle

If set to true, the Hyperlink shall look like the surrounding text without using the Hyperlink Style. May be used for text references, e.g. in tables, which shall not be rendered as links.

Type

Gets or sets the target type of the Hyperlink.

Values

Gets the underlying internal nullable values for the properties of this document object.

Methods

AcceptVisitor(DocumentObjectVisitor, bool)

Allows the visitor object to visit the document object and its child objects.

Add(Character)

Adds a new Character.

Add(BookmarkField)

Adds a new Bookmark.

Add(DateField)

Adds a new DateField.

Add(InfoField)

Adds a new InfoField.

Add(NumPagesField)

Adds a new NumPagesField.

Add(PageField)

Adds a new PageField.

Add(PageRefField)

Adds a new PageRefField.

Add(SectionField)

Adds a new SectionField.

Add(SectionPagesField)

Adds a new SectionPagesField.

Add(Footnote)

Adds a new Footnote.

Add(FormattedText)

Adds a new FormattedText.

Add(Image)

Adds a new Image.

Add(Text)

Adds a new Text.

AddBookmark(string, bool)

Adds a new Bookmark.

AddChar(char)

Adds a single character to the hyperlink.

AddChar(char, int)

Adds a single character repeated the specified number of times to the hyperlink.

AddCharacter(SymbolName)

Adds a Symbol object.

AddCharacter(SymbolName, int)

Adds one or more Symbol objects.

AddCharacter(char)

Adds a Symbol object defined by a character.

AddCharacter(char, int)

Adds one or more Symbol objects defined by a character.

AddDateField()

Adds a new DateField.

AddDateField(string)

Adds a new DateField.

AddFootnote()

Adds a new Footnote.

AddFootnote(string)

Adds a new Footnote with the specified text.

AddFormattedText()

Adds a new FormattedText.

AddFormattedText(Font)

Adds a new FormattedText with the given Font.

AddFormattedText(TextFormat)

Adds a new FormattedText object with the given format.

AddFormattedText(string)

Adds a new FormattedText with the given text.

AddFormattedText(string, Font)

Adds a new FormattedText object with the given text and font.

AddFormattedText(string, TextFormat)

Adds a new FormattedText object with the given text and format.

AddFormattedText(string, string)

Adds a new FormattedText object with the given text and style.

AddImage(string)

Adds a new Image object.

AddInfoField(InfoFieldType)

Adds a new InfoField.

AddNumPagesField()

Adds a new NumPagesField.

AddPageField()

Adds a new PageField.

AddPageRefField(string)

Adds a new PageRefField.

AddSectionField()

Adds a new SectionField.

AddSectionPagesField()

Adds a new SectionPagesField.

AddSpace(int)

Adds a space character as many as count.

AddTab()

Adds a horizontal tab.

AddText(string)

Adds a text phrase to the hyperlink.

Clone()

Creates a deep copy of this object.

CreateMailLink(string)

Initializes a new instance of the Hyperlink class with the type "Url" and text the hyperlink shall represent. The mailto protocol is automatically added if missing.

CreateWebLink(string)

Initializes a new instance of the Hyperlink class with the type "Url" and text the hyperlink shall represent. The HTTP protocol is automatically added if neither HTTP nor HTTPS is specified.

DeepCopy()

Implements the deep copy of the object.