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

    Show / Hide Table of Contents

    ContentPosition Class

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

    Represents a position within a DocumentModel.

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

    For more information, see content manipulation examples.

    Properties

    Parent

    Gets the parent that scopes the current ContentPosition.

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

    The parent that scopes the current ContentPosition.

    Methods

    InsertRange(ContentRange)

    Inserts the content of the specified ContentRange at the current ContentPosition.

    • C#
    • VB.NET
    public ContentPosition InsertRange(ContentRange range)
    Public Function InsertRange(range As ContentRange) As ContentPosition
    Parameters
    range
    ContentRange

    The ContentRange which content should be inserted at the current ContentPosition.

    Returns
    ContentPosition

    A ContentPosition instance which points to a location just after the inserted content.

    Remarks

    For more information, see Insert Content example.

    LoadFromClipboard(LoadOptions[])

    Loads the content of the clipboard at the current ContentPosition using specified text format.

    • C#
    • VB.NET
    public void LoadFromClipboard(params LoadOptions[] listOfOptions)
    Public Sub LoadFromClipboard(ParamArray listOfOptions As LoadOptions())
    Parameters
    listOfOptions
    LoadOptions[]

    List of LoadOptions type derivations mapping clipboard text formats.

    Remarks

    Applications which load data from clipboard should try to load it using the richest text format it supports.

    Following LoadOptions type derivations can be used: RtfLoadOptions, HtmlLoadOptions and TxtLoadOptions. If no LoadOptions is specified, content is loaded using first supported LoadOptions type derivation which successfully completed, trying in following order: RtfLoadOptions -> HtmlLoadOptions -> TxtLoadOptions.

    Exceptions
    ArgumentException

    LoadOptions type derivation supplied inside listOfOptions is not supported for this operation. Use one of the supported derivations: RtfLoadOptions, HtmlLoadOptions and TxtLoadOptions

    LoadFromClipboard(IEnumerable<LoadOptions>)

    Loads the content of the clipboard at the current ContentPosition using specified text format.

    • C#
    • VB.NET
    public void LoadFromClipboard(IEnumerable<LoadOptions> listOfOptions)
    Public Sub LoadFromClipboard(listOfOptions As IEnumerable(Of LoadOptions))
    Parameters
    listOfOptions
    IEnumerable<LoadOptions>

    List of LoadOptions type derivations mapping clipboard text formats.

    Remarks

    Applications which load data from clipboard should try to load it using the richest text format it supports.

    Following LoadOptions type derivations can be used: RtfLoadOptions, HtmlLoadOptions and TxtLoadOptions.

    Exceptions
    ArgumentException

    LoadOptions type derivation supplied inside listOfOptions is not supported for this operation. Use one of the supported derivations: RtfLoadOptions, HtmlLoadOptions and TxtLoadOptions

    LoadText(String)

    Loads the specified text at the current ContentPosition.

    • C#
    • VB.NET
    public ContentPosition LoadText(string text)
    Public Function LoadText(text As String) As ContentPosition
    Parameters
    text
    String

    The text which should be loaded at the current ContentPosition.

    Returns
    ContentPosition

    A ContentPosition instance which points to a location just after the loaded text.

    Remarks

    For more information, see Insert Content example.

    LoadText(String, CharacterFormat)

    Loads the specified text with specific formatting at the current ContentPosition.

    • C#
    • VB.NET
    public ContentPosition LoadText(string text, CharacterFormat format)
    Public Function LoadText(text As String, format As CharacterFormat) As ContentPosition
    Parameters
    text
    String

    The text which should be loaded at the current ContentPosition.

    format
    CharacterFormat

    The formatting of the text which should be loaded at the current ContentPosition.

    Returns
    ContentPosition

    A ContentPosition instance which points to a location just after the loaded text.

    Remarks

    For more information, see Insert Content example.

    LoadText(String, HtmlLoadOptions)

    Loads the specified HTML text at the current ContentPosition.

    • C#
    • VB.NET
    public ContentPosition LoadText(string html, HtmlLoadOptions options)
    Public Function LoadText(html As String, options As HtmlLoadOptions) As ContentPosition
    Parameters
    html
    String

    The HTML text which should be loaded at the current ContentPosition.

    options
    HtmlLoadOptions

    The options used to define settings for load operation.

    Returns
    ContentPosition

    A ContentPosition instance which points to a location just after the loaded HTML text.

    Remarks

    For more information, see Word Editor in ASP.NET and Insert Content example.

    LoadText(String, RtfLoadOptions)

    Loads the specified RTF text at the current ContentPosition.

    • C#
    • VB.NET
    public ContentPosition LoadText(string text, RtfLoadOptions options)
    Public Function LoadText(text As String, options As RtfLoadOptions) As ContentPosition
    Parameters
    text
    String

    The RTF text which should be loaded at the current ContentPosition.

    options
    RtfLoadOptions

    The options used to define settings for load operation.

    Returns
    ContentPosition

    A ContentPosition instance which points to a location just after the loaded RTF text.

    LoadText(String, TxtLoadOptions)

    Loads the specified text at the current ContentPosition.

    • C#
    • VB.NET
    public ContentPosition LoadText(string text, TxtLoadOptions options)
    Public Function LoadText(text As String, options As TxtLoadOptions) As ContentPosition
    Parameters
    text
    String

    The text which should be loaded at the current ContentPosition.

    options
    TxtLoadOptions

    The options used to define settings for load operation.

    Returns
    ContentPosition

    A ContentPosition instance which points to a location just after the loaded text.

    Remarks

    For more information, see Insert Content example.

    Examples

    Content manipulation examples
    Insert HTML and RTF content to Word file in C# and VB.NET
    Word Editor in ASP.NET
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.