skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RadFlowDocumentEditor

Defines utility class used for editing RadFlowDocument

Inheritance
System.Object
RadFlowDocumentEditor
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.Windows.Documents.Flow.Model.Editing
Assembly: Telerik.Windows.Documents.Flow.dll

Syntax

public class RadFlowDocumentEditor

Constructors

RadFlowDocumentEditor(RadFlowDocument)

Initializes a new instance of the RadFlowDocumentEditor class.

Declaration
public RadFlowDocumentEditor(RadFlowDocument document)
Parameters
RadFlowDocument document

The document.

Properties

CharacterFormatting

Gets the character formatting that will be used when creating new run elements.

Declaration
public CharacterProperties CharacterFormatting { get; }
Property Value
CharacterProperties

The character formatting.

Document

Gets the document to which this editor is associated.

Declaration
public RadFlowDocument Document { get; }
Property Value
RadFlowDocument

The document.

ParagraphFormatting

Gets the paragraph formatting that will be used when creating new paragraphs.

Declaration
public ParagraphProperties ParagraphFormatting { get; }
Property Value
ParagraphProperties

The paragraph formatting.

TableFormatting

Gets the table formatting that will be used when creating new tables.

Declaration
public TableProperties TableFormatting { get; }
Property Value
TableProperties

The table formatting.

Methods

DeleteBookmark(String)

Deletes a bookmark by name.

Declaration
public void DeleteBookmark(string name)
Parameters
System.String name

The name.

DeleteBookmark(Bookmark)

Deletes the bookmark.

Declaration
public void DeleteBookmark(Bookmark bookmark)
Parameters
Bookmark bookmark

The bookmark.

DeleteContent(InlineBase, InlineBase, Boolean)

Deletes the content between the start and end elements. The inlines' parents must be in the same block container.

Declaration
public void DeleteContent(InlineBase start, InlineBase end, bool inclusive = true)
Parameters
InlineBase start

The start inline element.

InlineBase end

The end inline element.

System.Boolean inclusive

Indicates if the start end elements should be deleted as well.

DeletePermissionRange(PermissionRange)

Deletes the permission range.

Declaration
public void DeletePermissionRange(PermissionRange permission)
Parameters
PermissionRange permission

The permission.

FindAll(String, Boolean, Boolean)

Finds all occurrences of a specified text in a RadFlowDocument.

Declaration
public ReadOnlyCollection<FindResult> FindAll(string text, bool matchCase = true, bool matchWholeWord = false)
Parameters
System.String text

The searched text.

System.Boolean matchCase

Indicates whether the casing should be matched.

System.Boolean matchWholeWord

Indicates whether only whole words should be matched.

Returns
System.Collections.ObjectModel.ReadOnlyCollection<FindResult>

Collection of type FindResult.

FindAll(Regex)

Finds all occurrences of a matched text by the specified regex in a RadFlowDocument.

Declaration
public ReadOnlyCollection<FindResult> FindAll(Regex regex)
Parameters
System.Text.RegularExpressions.Regex regex

The regex.

Returns
System.Collections.ObjectModel.ReadOnlyCollection<FindResult>

Collection of type FindResult.

InsertBookmark(String)

Inserts the bookmark with specified name.

Declaration
public Bookmark InsertBookmark(string name)
Parameters
System.String name

The name.

Returns
Bookmark

The created bookmark.

InsertBookmark(String, InlineBase, InlineBase)

Inserts the bookmark with specified name.

Declaration
public Bookmark InsertBookmark(string name, InlineBase inlineStart, InlineBase inlineEnd)
Parameters
System.String name

The name.

InlineBase inlineStart

The inline start. The start of the bookmark will be inserted before this inline.

InlineBase inlineEnd

The inline end. The end of the bookmark will be inserted after this inline.

Returns
Bookmark

The created bookmark.

InsertBreak(BreakType)

Inserts the break.

Declaration
public Break InsertBreak(BreakType type)
Parameters
BreakType type

The type of the break.

Returns
Break

The inserted break.

InsertComment(String)

Inserts the comment.

Declaration
public Comment InsertComment(string text)
Parameters
System.String text

The text of the comment.

Returns
Comment

The created comment.

InsertComment(String, InlineBase, InlineBase)

Inserts the comment.

Declaration
public Comment InsertComment(string text, InlineBase inlineStart, InlineBase inlineEnd)
Parameters
System.String text

The text.

InlineBase inlineStart

The inline start. The start of the comment will be inserted before this inline.

InlineBase inlineEnd

The inline end. The end of the comment will be inserted after this inline.

Returns
Comment

InsertComment(Comment)

Inserts the comment.

Declaration
public Comment InsertComment(Comment comment)
Parameters
Comment comment

The comment.

Returns
Comment

The comment.

InsertComment(Comment, InlineBase, InlineBase)

Inserts the comment.

Declaration
public Comment InsertComment(Comment comment, InlineBase inlineStart, InlineBase inlineEnd)
Parameters
Comment comment

The comment.

InlineBase inlineStart

The inline start. The start of the comment will be inserted before this inline.

InlineBase inlineEnd

The inline end. The end of the comment will be inserted after this inline.

Returns
Comment

The comment.

InsertDocument(RadFlowDocument)

Inserts the source document at the current position in the target document.

Declaration
public void InsertDocument(RadFlowDocument sourceDocument)
Parameters
RadFlowDocument sourceDocument

The source document.

InsertDocument(RadFlowDocument, InsertDocumentOptions)

Inserts the source document at the current position in the target document.

Declaration
public void InsertDocument(RadFlowDocument sourceDocument, InsertDocumentOptions insertOptions)
Parameters
RadFlowDocument sourceDocument

The source document.

InsertDocumentOptions insertOptions

The insert options.

InsertField(String, String)

Inserts new field.

Declaration
public FieldInfo InsertField(string code, string result = "")
Parameters
System.String code

The code fragment.

System.String result

The result fragment.

Returns
FieldInfo

InsertFloatingImage(Stream, String)

Inserts a floating image with its original size.

Declaration
public FloatingImage InsertFloatingImage(Stream stream, string extension)
Parameters
System.IO.Stream stream

The stream.

System.String extension

The extension.

Returns
FloatingImage

The inserted floating image.

InsertFloatingImage(Stream, String, Size)

Inserts a floating image.

Declaration
public FloatingImage InsertFloatingImage(Stream stream, string extension, Size size)
Parameters
System.IO.Stream stream

The image stream.

System.String extension

The image extension.

System.Windows.Size size

The size.

Returns
FloatingImage

The floating image inline.

InsertFloatingImage(ImageSource, Size)

Inserts a floating image.

Declaration
public FloatingImage InsertFloatingImage(ImageSource source, Size size)
Parameters
ImageSource source

The image source.

System.Windows.Size size

The size.

Returns
FloatingImage

The floating image inline.

InsertHyperlink(String, String, Boolean, String)

Inserts the hyperlink.

Declaration
public Hyperlink InsertHyperlink(string text, string uri, bool isAnchor, string toolTip = null)
Parameters
System.String text

The text.

System.String uri

The URI.

System.Boolean isAnchor

True for hyperlinks pointing to a bookmark.

System.String toolTip

The tool tip.

Returns
Hyperlink

InsertImageInline(Stream, String)

Inserts an inline image with its original size.

Declaration
public ImageInline InsertImageInline(Stream stream, string extension)
Parameters
System.IO.Stream stream

The stream.

System.String extension

The extension.

Returns
ImageInline

The inserted inline image.

InsertImageInline(Stream, String, Size)

Inserts the image inline.

Declaration
public ImageInline InsertImageInline(Stream stream, string extension, Size size)
Parameters
System.IO.Stream stream

The image stream.

System.String extension

The image extension.

System.Windows.Size size

The size.

Returns
ImageInline

The inserted image inline.

InsertImageInline(ImageSource, Size)

Inserts an inline image.

Declaration
public ImageInline InsertImageInline(ImageSource source, Size size)
Parameters
ImageSource source

The image source.

System.Windows.Size size

The size.

Returns
ImageInline

The inserted image inline.

InsertInline(InlineBase)

Inserts an inline.

Declaration
public InlineBase InsertInline(InlineBase inline)
Parameters
InlineBase inline

The inline.

Returns
InlineBase

The inline.

InsertLine(String)

Inserts text and adds new paragraph after it.

Declaration
public Run InsertLine(string text)
Parameters
System.String text

The text.

Returns
Run

The inserted last inserted Run element.

InsertParagraph()

Inserts a new paragraph.

Declaration
public Paragraph InsertParagraph()
Returns
Paragraph

The inserted Paragraph element.

InsertPermissionRange(PermissionRangeCredentials, InlineBase, InlineBase)

Inserts the permission range surrounding inline start and inline end.

Declaration
public PermissionRange InsertPermissionRange(PermissionRangeCredentials permissionRangeCredentials, InlineBase inlineStart, InlineBase inlineEnd)
Parameters
PermissionRangeCredentials permissionRangeCredentials

The permission range credentials.

InlineBase inlineStart

The inline start.

InlineBase inlineEnd

The inline end.

Returns
PermissionRange

InsertPermissionRange(PermissionRangeCredentials, TableCell)

Inserts the permission range surrounding table cell.

Declaration
public PermissionRange InsertPermissionRange(PermissionRangeCredentials permissionRangeCredentials, TableCell cell)
Parameters
PermissionRangeCredentials permissionRangeCredentials

The permission range credentials.

TableCell cell

The cell.

Returns
PermissionRange

InsertPermissionRange(PermissionRangeCredentials, TableRow)

Inserts the permission range surrounding table row.

Declaration
public PermissionRange InsertPermissionRange(PermissionRangeCredentials permissionRangeCredentials, TableRow row)
Parameters
PermissionRangeCredentials permissionRangeCredentials

The permission range credentials.

TableRow row

The row.

Returns
PermissionRange

InsertSection()

Inserts a new section.

Declaration
public Section InsertSection()
Returns
Section

The inserted Section element.

InsertStructuredDocumentTag(SdtProperties)

Inserts a SDT (Structured Document Tag).

Declaration
public SdtRangeStart InsertStructuredDocumentTag(SdtProperties properties)
Parameters
SdtProperties properties

The properties of the SDT.

Returns
SdtRangeStart

InsertStructuredDocumentTag(SdtProperties, DocumentElementBase, DocumentElementBase)

Inserts a SDT (Structured Document Tag).

Declaration
public SdtRangeStart InsertStructuredDocumentTag(SdtProperties properties, DocumentElementBase startElement, DocumentElementBase endElement)
Parameters
SdtProperties properties

The properties of the SDT.

DocumentElementBase startElement

The start of the SDT will be inserted before the provided element.

DocumentElementBase endElement

The end of the SDT will be inserted after the provided element.

Returns
SdtRangeStart

InsertStructuredDocumentTag(SdtType)

Inserts a SDT (Structured Document Tag).

Declaration
public SdtRangeStart InsertStructuredDocumentTag(SdtType type)
Parameters
SdtType type

The type for the SDT to be generated.

Returns
SdtRangeStart

InsertStructuredDocumentTag(SdtType, DocumentElementBase, DocumentElementBase)

Inserts a SDT (Structured Document Tag).

Declaration
public SdtRangeStart InsertStructuredDocumentTag(SdtType type, DocumentElementBase startElement, DocumentElementBase endElement)
Parameters
SdtType type

The type for the SDT to be generated.

DocumentElementBase startElement

The start of the SDT will be inserted before the provided element.

DocumentElementBase endElement

The end of the SDT will be inserted after the provided element.

Returns
SdtRangeStart

InsertTable()

Inserts a new table and positions the editor after the table.

Declaration
public Table InsertTable()
Returns
Table

The inserted table.

InsertTable(Int32, Int32)

Inserts a new table and positions the editor after the table.

Declaration
public Table InsertTable(int rows, int columns)
Parameters
System.Int32 rows

The number of rows in the table.

System.Int32 columns

The number of columns in the table.

Returns
Table

The inserted table.

InsertText(String)

Inserts text.

Declaration
public Run InsertText(string text)
Parameters
System.String text

The text.

Returns
Run

The inserted last inserted Run element.

MoveToInlineEnd(InlineBase)

Moves the editor after an inline.

Declaration
public void MoveToInlineEnd(InlineBase inline)
Parameters
InlineBase inline

The inline.

MoveToInlineStart(InlineBase)

Moves the editor before an inline.

Declaration
public void MoveToInlineStart(InlineBase inline)
Parameters
InlineBase inline

The inline.

MoveToParagraphEnd(Paragraph)

Moves the editor to the end of a paragraph.

Declaration
public void MoveToParagraphEnd(Paragraph paragraph)
Parameters
Paragraph paragraph

The paragraph.

MoveToParagraphStart(Paragraph)

Moves the editor to the start of a paragraph.

Declaration
public void MoveToParagraphStart(Paragraph paragraph)
Parameters
Paragraph paragraph

The paragraph.

MoveToTableEnd(Table)

Moves the editor to a table end.

Declaration
public void MoveToTableEnd(Table table)
Parameters
Table table

The table.

Protect(String)

Protects the editor document from changes with specified password in read only protection mode.

Declaration
public void Protect(string password)
Parameters
System.String password

The password.

Protect(String, ProtectionMode)

Protects the editor document from changes with specified password in desired protection mode.

Declaration
public void Protect(string password, ProtectionMode protectionMode)
Parameters
System.String password

The password.

ProtectionMode protectionMode

The protection mode.

RemoveStructuredDocumentTag(SdtRangeStart)

Removes a SDT(Structured Document Tag) with its contents.

Declaration
public void RemoveStructuredDocumentTag(SdtRangeStart sdtRangeStart)
Parameters
SdtRangeStart sdtRangeStart

The start of the SDT to be removed.

RemoveStructuredDocumentTag(SdtRangeStart, Boolean)

Removes a SDT(Structured Document Tag).

Declaration
public void RemoveStructuredDocumentTag(SdtRangeStart sdtRangeStart, bool removeContent)
Parameters
SdtRangeStart sdtRangeStart

The start of the SDT to be removed.

System.Boolean removeContent

If true the content of the SDT is removed; else only the SDT is removed leaving behind the content.

ReplaceStyling(String, Action<CharacterProperties>)

Replaces character properties of all occurrences of the searched text in a RadFlowDocument.

Declaration
public void ReplaceStyling(string searchedText, Action<CharacterProperties> replacePropertiesAction)
Parameters
System.String searchedText

The searched text.

System.Action<CharacterProperties> replacePropertiesAction

The action which replaces character properties.

ReplaceStyling(String, Boolean, Boolean, Action<CharacterProperties>)

Replaces character properties of all occurrences of the searched text in a RadFlowDocument.

Declaration
public void ReplaceStyling(string searchedText, bool matchCase, bool matchWholeWord, Action<CharacterProperties> replacePropertiesAction)
Parameters
System.String searchedText

The searched text.

System.Boolean matchCase

Indicates whether the casing should be matched.

System.Boolean matchWholeWord

Indicates whether only whole words should be matched.

System.Action<CharacterProperties> replacePropertiesAction

The action which replaces character properties.

ReplaceStyling(Regex, Action<CharacterProperties>)

Replaces character properties of all occurrences of a

matched text by the specified regex in a RadFlowDocument.

Declaration
public void ReplaceStyling(Regex regex, Action<CharacterProperties> replacePropertiesAction)
Parameters
System.Text.RegularExpressions.Regex regex

The regex.

System.Action<CharacterProperties> replacePropertiesAction

The action which replaces character properties.

ReplaceText(String, IEnumerable<BlockBase>, Boolean, Boolean)

Replaces all occurrences of a specified text in a RadFlowDocument.

Declaration
public void ReplaceText(string oldText, IEnumerable<BlockBase> blocks, bool matchCase = true, bool matchWholeWord = false)
Parameters
System.String oldText

The searched text.

System.Collections.Generic.IEnumerable<BlockBase> blocks

The replace System.Collections.Generic.IEnumerable<T> elements.

System.Boolean matchCase

Indicates whether the casing should be matched.

System.Boolean matchWholeWord

Indicates whether only whole words should be matched.

ReplaceText(String, IEnumerable<InlineBase>, Boolean, Boolean)

Replaces all occurrences of a specified text in a RadFlowDocument.

Declaration
public void ReplaceText(string oldText, IEnumerable<InlineBase> inlines, bool matchCase = true, bool matchWholeWord = false)
Parameters
System.String oldText

The searched text.

System.Collections.Generic.IEnumerable<InlineBase> inlines

The replace System.Collections.Generic.IEnumerable<T> elements.

System.Boolean matchCase

Indicates whether the casing should be matched.

System.Boolean matchWholeWord

Indicates whether only whole words should be matched.

ReplaceText(String, String, Boolean, Boolean)

Replaces all occurrences of a specified text in a RadFlowDocument.

Declaration
public void ReplaceText(string oldText, string newText, bool matchCase = true, bool matchWholeWord = false)
Parameters
System.String oldText

The searched text.

System.String newText

The replace text.

System.Boolean matchCase

Indicates whether the casing should be matched.

System.Boolean matchWholeWord

Indicates whether only whole words should be matched.

ReplaceText(String, BlockBase, Boolean, Boolean)

Replaces all occurrences of a specified text in a RadFlowDocument.

Declaration
public void ReplaceText(string oldText, BlockBase block, bool matchCase = true, bool matchWholeWord = false)
Parameters
System.String oldText

The searched text.

BlockBase block

The replace BlockBase elements.

System.Boolean matchCase

Indicates whether the casing should be matched.

System.Boolean matchWholeWord

Indicates whether only whole words should be matched.

ReplaceText(String, InlineBase, Boolean, Boolean)

Replaces all occurrences of a specified text in a RadFlowDocument.

Declaration
public void ReplaceText(string oldText, InlineBase inline, bool matchCase = true, bool matchWholeWord = false)
Parameters
System.String oldText

The searched text.

InlineBase inline

The replace InlineBase elements.

System.Boolean matchCase

Indicates whether the casing should be matched.

System.Boolean matchWholeWord

Indicates whether only whole words should be matched.

ReplaceText(Regex, IEnumerable<BlockBase>)

Replaces all occurrences of a matched text by the specified regex in a RadFlowDocument.

Declaration
public void ReplaceText(Regex regex, IEnumerable<BlockBase> blocks)
Parameters
System.Text.RegularExpressions.Regex regex

The regex.

System.Collections.Generic.IEnumerable<BlockBase> blocks

The replace System.Collections.Generic.IEnumerable<T> elements.

ReplaceText(Regex, IEnumerable<InlineBase>)

Replaces all occurrences of a matched text by the specified regex in a RadFlowDocument.

Declaration
public void ReplaceText(Regex regex, IEnumerable<InlineBase> inlines)
Parameters
System.Text.RegularExpressions.Regex regex

The regex.

System.Collections.Generic.IEnumerable<InlineBase> inlines

The replace System.Collections.Generic.IEnumerable<T> elements.

ReplaceText(Regex, String)

Replaces all occurrences of a matched text by the specified regex in a RadFlowDocument.

Declaration
public void ReplaceText(Regex regex, string newText)
Parameters
System.Text.RegularExpressions.Regex regex

The regex.

System.String newText

The replace text.

ReplaceText(Regex, BlockBase)

Replaces all occurrences of a matched text by the specified regex in a RadFlowDocument.

Declaration
public void ReplaceText(Regex regex, BlockBase block)
Parameters
System.Text.RegularExpressions.Regex regex

The regex.

BlockBase block

The replace BlockBase element.

ReplaceText(Regex, InlineBase)

Replaces all occurrences of a matched text by the specified regex in a RadFlowDocument.

Declaration
public void ReplaceText(Regex regex, InlineBase inline)
Parameters
System.Text.RegularExpressions.Regex regex

The regex.

InlineBase inline

The replace InlineBase elements.

SetSdtMessageProvider(IMessageProvider)

Sets a custom message provider for the messages when creating a structured document tag.

Declaration
public void SetSdtMessageProvider(IMessageProvider provider)
Parameters
IMessageProvider provider

A custom message provider which implements IMessageProvider.

SetWatermark(Watermark, Header)

Sets the watermark to the specified header.

Declaration
public void SetWatermark(Watermark watermark, Header header)
Parameters
Watermark watermark

The watermark.

Header header

The header.

SetWatermark(Watermark, Section, HeaderFooterType)

Sets the watermark to the header of the specified type associated with the specified section.

Declaration
public void SetWatermark(Watermark watermark, Section section, HeaderFooterType headerType)
Parameters
Watermark watermark

The watermark.

Section section

The section.

HeaderFooterType headerType

Type of the header.

Unprotect()

Unprotects the editor document.

Declaration
public void Unprotect()

Unprotect(String)

Tries to unprotect the editor document with specified password.

Declaration
public bool Unprotect(string password)
Parameters
System.String password

The password.

Returns
System.Boolean

True if the password is correct; otherwise, False.

Getting Started
  • Getting Started
Support Resources
  • Documentation
Community
  • Forums
  • Blogs
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.