Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

RtfParagraph

Namespace OfficeIMO.Rtf
Assembly OfficeIMO.Rtf
Implements
IRtfCloneable IRtfBlock
Modifiers sealed

Paragraph in an RTF document.

Inheritance

  • Object
  • RtfParagraph

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters

Constructors

Methods

public RtfRun AddAnnotation(String referenceText, String noteText) #
Returns: RtfRun

Adds an annotation reference run with note text.

Parameters

referenceText System.String requiredposition: 0
noteText System.String requiredposition: 1
public RtfBookmarkMarker AddBookmarkEnd(String name) #
Returns: RtfBookmarkMarker

Adds a bookmark end marker at the current paragraph position.

Parameters

name System.String requiredposition: 0
public RtfBookmarkMarker AddBookmarkStart(String name) #
Returns: RtfBookmarkMarker

Adds a bookmark start marker at the current paragraph position.

Parameters

name System.String requiredposition: 0
public RtfBreak AddBreak(RtfBreakKind kind) #
Returns: RtfBreak

Adds an explicit break at the current paragraph position.

Parameters

kind OfficeIMO.Rtf.RtfBreakKind requiredposition: 0
public RtfBreak AddColumnBreak() #
Returns: RtfBreak

Adds a column break at the current paragraph position.

public RtfGeneratedText AddCurrentDate(String fallbackText = null) #
Returns: RtfGeneratedText

Adds a generated current date marker.

Parameters

fallbackText System.String = null optionalposition: 0
public RtfGeneratedText AddCurrentDateAbbreviated(String fallbackText = null) #
Returns: RtfGeneratedText

Adds a generated current date marker in abbreviated format.

Parameters

fallbackText System.String = null optionalposition: 0
public RtfGeneratedText AddCurrentDateLong(String fallbackText = null) #
Returns: RtfGeneratedText

Adds a generated current date marker in long format.

Parameters

fallbackText System.String = null optionalposition: 0
public RtfGeneratedText AddCurrentTime(String fallbackText = null) #
Returns: RtfGeneratedText

Adds a generated current time marker.

Parameters

fallbackText System.String = null optionalposition: 0
public RtfRun AddEndnote(String referenceText, String noteText) #
Returns: RtfRun

Adds a superscript endnote reference run with note text.

Parameters

referenceText System.String requiredposition: 0
noteText System.String requiredposition: 1
public RtfField AddEquationField(String equationInstruction, String resultText) #
Returns: RtfField

Adds a Word EQ equation field with cached visible fallback text.

Parameters

equationInstruction System.String requiredposition: 0
resultText System.String requiredposition: 1
public RtfField AddField(String instruction) #
Returns: RtfField

Adds an RTF field at the current paragraph position.

Parameters

instruction System.String requiredposition: 0
public RtfRun AddFootnote(String referenceText, String noteText) #
Returns: RtfRun

Adds a superscript footnote reference run with note text.

Parameters

referenceText System.String requiredposition: 0
noteText System.String requiredposition: 1
public RtfGeneratedText AddGeneratedText(RtfGeneratedTextKind kind, String fallbackText = null) #
Returns: RtfGeneratedText

Adds a generated text marker at the current paragraph position.

Parameters

kind OfficeIMO.Rtf.RtfGeneratedTextKind requiredposition: 0
fallbackText System.String = null optionalposition: 1
public RtfImage AddImage(RtfImageFormat format, Byte[] data) #
Returns: RtfImage

Adds a picture at the current paragraph position.

Parameters

format OfficeIMO.Rtf.RtfImageFormat requiredposition: 0
data System.Byte[] requiredposition: 1
public RtfBreak AddLineBreak() #
Returns: RtfBreak

Adds a line break at the current paragraph position.

public RtfGeneratedText AddNoteReference(RtfNote note, String fallbackText = null) #
Returns: RtfGeneratedText

Adds an automatic note reference marker and attaches the supplied note to it.

Parameters

note OfficeIMO.Rtf.RtfNote requiredposition: 0
fallbackText System.String = null optionalposition: 1
public RtfObject AddObject(RtfObjectKind kind = Unknown, Byte[] data = null) #
Returns: RtfObject

Adds an embedded or linked object at the current paragraph position.

Parameters

kind OfficeIMO.Rtf.RtfObjectKind = Unknown optionalposition: 0
data System.Byte[] = null optionalposition: 1
public RtfBreak AddPageBreak() #
Returns: RtfBreak

Adds a page break at the current paragraph position.

public RtfGeneratedText AddPageNumber(String fallbackText = null) #
Returns: RtfGeneratedText

Adds a generated current page number marker.

Parameters

fallbackText System.String = null optionalposition: 0
public RtfGeneratedText AddSectionNumber(String fallbackText = null) #
Returns: RtfGeneratedText

Adds a generated current section number marker.

Parameters

fallbackText System.String = null optionalposition: 0
public RtfShape AddShape() #
Returns: RtfShape

Adds a drawing shape at the current paragraph position.

public RtfBreak AddSoftLineBreak() #
Returns: RtfBreak

Adds a soft line break at the current paragraph position.

public RtfBreak AddSoftPageBreak() #
Returns: RtfBreak

Adds a soft page break at the current paragraph position.

public RtfTabStop AddTabStop(Int32 positionTwips, RtfTabAlignment alignment = Left, RtfTabLeader leader = None) #
Returns: RtfTabStop

Adds a tab stop to the paragraph.

Parameters

positionTwips System.Int32 requiredposition: 0
alignment OfficeIMO.Rtf.RtfTabAlignment = Left optionalposition: 1
leader OfficeIMO.Rtf.RtfTabLeader = None optionalposition: 2
public RtfRun AddText(String text) #
Returns: RtfRun

Adds a text run.

Parameters

text System.String requiredposition: 0
public RtfParagraph ClearListText() #
Returns: RtfParagraph

Clears fallback list marker text.

public Int32 ReplaceText(String oldText, String newText, StringComparison comparison = Ordinal) #
Returns: Int32

Replaces text across adjacent runs. Replacement text inherits formatting from the run where each match begins; unaffected prefix and suffix runs keep their existing formatting.

Parameters

oldText System.String requiredposition: 0
newText System.String requiredposition: 1
comparison System.StringComparison = Ordinal optionalposition: 2
public RtfParagraph SetAdjustRightIndent(Nullable<Boolean> enabled = true) #
Returns: RtfParagraph

Sets automatic right-indent adjustment for document-grid layouts.

Parameters

enabled System.Nullable{System.Boolean} = true optionalposition: 0
public RtfParagraph SetAlignment(RtfTextAlignment alignment) #
Returns: RtfParagraph

Sets paragraph alignment.

Parameters

alignment OfficeIMO.Rtf.RtfTextAlignment requiredposition: 0
public RtfParagraph SetBackgroundColor(Nullable<Int32> colorIndex) #
Returns: RtfParagraph

Sets paragraph background shading to a one-based color table index.

Parameters

colorIndex System.Nullable{System.Int32} requiredposition: 0
public RtfParagraph SetBorder(RtfParagraphBorderSide side, RtfParagraphBorderStyle style, Nullable<Int32> width = null, Nullable<Int32> colorIndex = null) #
Returns: RtfParagraph

Sets paragraph border formatting for one side.

Parameters

side OfficeIMO.Rtf.RtfParagraphBorderSide requiredposition: 0
style OfficeIMO.Rtf.RtfParagraphBorderStyle requiredposition: 1
width System.Nullable{System.Int32} = null optionalposition: 2
colorIndex System.Nullable{System.Int32} = null optionalposition: 3
public RtfParagraph SetContextualSpacing(Nullable<Boolean> enabled = true) #
Returns: RtfParagraph

Sets contextual paragraph spacing.

Parameters

enabled System.Nullable{System.Boolean} = true optionalposition: 0
public RtfParagraph SetDirection(Nullable<RtfTextDirection> direction) #
Returns: RtfParagraph

Sets explicit paragraph text direction.

Parameters

direction System.Nullable{OfficeIMO.Rtf.RtfTextDirection} requiredposition: 0
public RtfParagraph SetFrame(Action<RtfParagraphFrame> configure) #
Returns: RtfParagraph

Configures absolute positioning frame metadata for this paragraph.

Parameters

configure System.Action{OfficeIMO.Rtf.RtfParagraphFrame} requiredposition: 0
public RtfParagraph SetIndentation(Nullable<Int32> leftTwips = null, Nullable<Int32> rightTwips = null, Nullable<Int32> firstLineTwips = null) #
Returns: RtfParagraph

Sets paragraph indentation in twips.

Parameters

leftTwips System.Nullable{System.Int32} = null optionalposition: 0
rightTwips System.Nullable{System.Int32} = null optionalposition: 1
firstLineTwips System.Nullable{System.Int32} = null optionalposition: 2
public RtfParagraph SetLegacyNumbering(Action<RtfLegacyNumbering> configure) #
Returns: RtfParagraph

Configures Word 6/95 legacy paragraph numbering metadata.

Parameters

configure System.Action{OfficeIMO.Rtf.RtfLegacyNumbering} requiredposition: 0
public RtfParagraph SetLineSpacing(Nullable<Int32> lineSpacingTwips, Nullable<Boolean> multiple = null) #
Returns: RtfParagraph

Sets raw RTF paragraph line spacing controls.

Parameters

lineSpacingTwips System.Nullable{System.Int32} requiredposition: 0
multiple System.Nullable{System.Boolean} = null optionalposition: 1
public RtfParagraph SetList(Int32 listId = 1, Int32 level = 0, RtfListKind kind = Bullet) #
Returns: RtfParagraph

Marks the paragraph as a list item.

Parameters

listId System.Int32 = 1 optionalposition: 0
level System.Int32 = 0 optionalposition: 1
kind OfficeIMO.Rtf.RtfListKind = Bullet optionalposition: 2
SetListText 2 overloads
public RtfParagraph SetListText(String text) #
Returns: RtfParagraph

Sets plain fallback list marker text emitted in a \listtext destination.

Parameters

text System.String requiredposition: 0
public RtfParagraph SetListText(Action<RtfParagraph> configure) #
Returns: RtfParagraph

Configures rich fallback list marker content emitted in a \listtext destination.

Parameters

configure System.Action{OfficeIMO.Rtf.RtfParagraph} requiredposition: 0
public RtfParagraph SetOutlineLevel(Nullable<Int32> outlineLevel) #
Returns: RtfParagraph

Sets the paragraph outline level.

Parameters

outlineLevel System.Nullable{System.Int32} requiredposition: 0
public RtfParagraph SetPagination(Nullable<Boolean> pageBreakBefore = null, Nullable<Boolean> keepWithNext = null, Nullable<Boolean> keepLinesTogether = null, Nullable<Boolean> widowControl = null, Nullable<Boolean> suppressLineNumbers = null, Nullable<Boolean> autoHyphenation = null) #
Returns: RtfParagraph

Sets paragraph pagination controls.

Parameters

pageBreakBefore System.Nullable{System.Boolean} = null optionalposition: 0
keepWithNext System.Nullable{System.Boolean} = null optionalposition: 1
keepLinesTogether System.Nullable{System.Boolean} = null optionalposition: 2
widowControl System.Nullable{System.Boolean} = null optionalposition: 3
suppressLineNumbers System.Nullable{System.Boolean} = null optionalposition: 4
autoHyphenation System.Nullable{System.Boolean} = null optionalposition: 5
public RtfParagraph SetParagraphSpacing(Nullable<Int32> beforeTwips = null, Nullable<Int32> afterTwips = null, Nullable<Boolean> beforeAuto = null, Nullable<Boolean> afterAuto = null) #
Returns: RtfParagraph

Sets paragraph spacing before and after this paragraph.

Parameters

beforeTwips System.Nullable{System.Int32} = null optionalposition: 0
afterTwips System.Nullable{System.Int32} = null optionalposition: 1
beforeAuto System.Nullable{System.Boolean} = null optionalposition: 2
afterAuto System.Nullable{System.Boolean} = null optionalposition: 3
public RtfParagraph SetRevisionSaveId(Nullable<Int32> id) #
Returns: RtfParagraph

Sets the paragraph revision save identifier represented by \pararsid.

Parameters

id System.Nullable{System.Int32} requiredposition: 0
public RtfParagraph SetShading(Nullable<Int32> backgroundColorIndex, Nullable<Int32> foregroundColorIndex = null, Nullable<Int32> patternPercent = null, RtfShadingPattern pattern = None) #
Returns: RtfParagraph

Sets paragraph shading color and pattern metadata.

Parameters

backgroundColorIndex System.Nullable{System.Int32} requiredposition: 0
foregroundColorIndex System.Nullable{System.Int32} = null optionalposition: 1
patternPercent System.Nullable{System.Int32} = null optionalposition: 2
pattern OfficeIMO.Rtf.RtfShadingPattern = None optionalposition: 3
public RtfParagraph SetSnapToLineGrid(Nullable<Boolean> enabled = true) #
Returns: RtfParagraph

Sets whether paragraph lines snap to the document line grid.

Parameters

enabled System.Nullable{System.Boolean} = true optionalposition: 0
public RtfParagraph SetStyle(Int32 styleId) #
Returns: RtfParagraph

Sets the paragraph style id.

Parameters

styleId System.Int32 requiredposition: 0
public String ToPlainText() #
Returns: String

Returns plain text for the paragraph.

Properties

public IReadOnlyList<RtfRun> Runs { get; } #

Paragraph runs.

public IReadOnlyList<IRtfInline> Inlines { get; } #

Paragraph inline content in original order, including non-text markers such as bookmarks.

public IReadOnlyList<RtfTabStop> TabStops { get; } #

Paragraph tab stops in RTF declaration order.

public RtfTextAlignment Alignment { get; set; } #

Paragraph alignment.

public Nullable<RtfTextAlignment> DirectAlignment { get; set; } #

Authored Alignment override. Null inherits from the selected style; an explicit default clears that style value.

public Nullable<RtfTextDirection> Direction { get; set; } #

Explicit paragraph text direction represented by \ltrpar or \rtlpar.

public Nullable<Int32> StyleId { get; set; } #

Optional paragraph stylesheet id.

public Nullable<Int32> ListId { get; set; } #

Optional list id for paragraphs bound to an RTF list override.

public Nullable<Int32> ListDefinitionId { get; set; } #

Optional list definition id resolved through the list override table.

public Nullable<Int32> ListLevel { get; set; } #

Optional zero-based list level.

public RtfListKind ListKind { get; set; } #

Basic list marker kind.

public RtfLegacyNumbering LegacyNumbering { get; set; } #

Word 6/95 legacy paragraph numbering metadata from \pn* controls.

public RtfParagraph ListText { get; set; } #

Word list marker fallback text represented by a paragraph-level \listtext destination.

public Nullable<Int32> LeftIndentTwips { get; set; } #

Left indentation in twips.

public Nullable<Int32> RightIndentTwips { get; set; } #

Right indentation in twips.

public Nullable<Int32> FirstLineIndentTwips { get; set; } #

First-line indentation in twips.

public Nullable<Int32> SpaceBeforeTwips { get; set; } #

Space before paragraph in twips.

public Nullable<Int32> SpaceAfterTwips { get; set; } #

Space after paragraph in twips.

public Nullable<Boolean> SpaceBeforeAuto { get; set; } #

Whether space before the paragraph is automatically determined by the renderer.

public Nullable<Boolean> SpaceAfterAuto { get; set; } #

Whether space after the paragraph is automatically determined by the renderer.

public Nullable<Int32> LineSpacingTwips { get; set; } #

Raw RTF line spacing value from \sl.

public Nullable<Boolean> LineSpacingMultiple { get; set; } #

Whether \sl is interpreted as multiple line spacing by \slmult. Null means not specified.

public Nullable<Int32> BackgroundColorIndex { get; set; } #

One-based color table index used by paragraph background shading.

public Nullable<Int32> ShadingForegroundColorIndex { get; set; } #

One-based color table index used by paragraph pattern foreground shading.

public Nullable<Int32> ShadingPatternPercent { get; set; } #

Raw RTF \shading value, where 10000 represents 100 percent.

public RtfShadingPattern ShadingPattern { get; set; } #

Named RTF shading pattern.

public RtfParagraphBorder TopBorder { get; set; } #

Top paragraph border.

public RtfParagraphBorder LeftBorder { get; set; } #

Left paragraph border.

public RtfParagraphBorder BottomBorder { get; set; } #

Bottom paragraph border.

public RtfParagraphBorder RightBorder { get; set; } #

Right paragraph border.

public Boolean PageBreakBefore { get; set; } #

Whether a page break should be emitted before this paragraph.

public Nullable<Boolean> DirectPageBreakBefore { get; set; } #

Authored PageBreakBefore override. Null inherits from the selected style; an explicit default clears that style value.

public Boolean KeepWithNext { get; set; } #

Whether this paragraph should stay on the same page as the following paragraph.

public Nullable<Boolean> DirectKeepWithNext { get; set; } #

Authored KeepWithNext override. Null inherits from the selected style; an explicit default clears that style value.

public Boolean KeepLinesTogether { get; set; } #

Whether all lines in this paragraph should stay together on the same page.

public Nullable<Boolean> DirectKeepLinesTogether { get; set; } #

Authored KeepLinesTogether override. Null inherits from the selected style; an explicit default clears that style value.

public Boolean SuppressLineNumbers { get; set; } #

Whether line numbering is suppressed for this paragraph.

public Nullable<Boolean> DirectSuppressLineNumbers { get; set; } #

Authored SuppressLineNumbers override. Null inherits from the selected style; an explicit default clears that style value.

public Nullable<Boolean> AutoHyphenation { get; set; } #

Paragraph-level automatic hyphenation override represented by \hyphpar.

public Nullable<Boolean> ContextualSpacing { get; set; } #

Whether contextual paragraph spacing is explicitly enabled or disabled.

public Nullable<Boolean> AdjustRightIndent { get; set; } #

Whether the right indent is automatically adjusted when a document grid is defined.

public Nullable<Boolean> SnapToLineGrid { get; set; } #

Whether paragraph lines snap to the document line grid.

public Nullable<Boolean> WidowControl { get; set; } #

Explicit paragraph widow/orphan control. Null means not specified.

public Nullable<Int32> OutlineLevel { get; set; } #

Optional paragraph outline level.

public Nullable<Int32> RevisionSaveId { get; set; } #

Paragraph revision save identifier represented by \pararsid.

public RtfParagraphFrame Frame { get; set; } #

Absolute positioning, text wrapping, and drop-cap metadata for this paragraph.