API Reference
RtfParagraph
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.
Returned or exposed by
- Method RtfDocument.AddParagraph
- Method RtfDocument.InsertParagraph
- Method RtfDocument.ResolveParagraphFormatting
- Property RtfDocument.Paragraphs
- Property RtfField.Result
- Method RtfHeaderFooter.AddParagraph
- Property RtfHeaderFooter.Paragraphs
- Method RtfNote.AddParagraph
- Property RtfNote.Paragraphs
- Property RtfObject.Result
- Method RtfParagraph.ClearListText
- Method RtfParagraph.SetAdjustRightIndent
- Method RtfParagraph.SetAlignment
- Method RtfParagraph.SetBackgroundColor
- Method RtfParagraph.SetBorder
- Method RtfParagraph.SetContextualSpacing
- Method RtfParagraph.SetDirection
- Method RtfParagraph.SetFrame
- Method RtfParagraph.SetIndentation
- Method RtfParagraph.SetLegacyNumbering
- Method RtfParagraph.SetLineSpacing
- Method RtfParagraph.SetList
- Method RtfParagraph.SetListText
- Method RtfParagraph.SetListText
- Method RtfParagraph.SetOutlineLevel
- Method RtfParagraph.SetPagination
- Method RtfParagraph.SetParagraphSpacing
- Method RtfParagraph.SetRevisionSaveId
- Method RtfParagraph.SetShading
- Method RtfParagraph.SetSnapToLineGrid
- Method RtfParagraph.SetStyle
- Property RtfParagraph.ListText
- Method RtfSection.AddParagraph
- Method RtfShape.AddTextBoxParagraph
- Property RtfShape.TextBoxParagraphs
- Method RtfTableCell.AddParagraph
- Property RtfTableCell.Paragraphs
Accepted by parameters
- Method RtfDocument.ResolveListFormatting
- Method RtfDocument.ResolveParagraphFormatting
- Method RtfDocument.ResolveRunFormatting
- Method RtfListNumbering.Next
- Method RtfParagraph.SetListText
Constructors
public RtfParagraph() #Methods
public RtfRun AddAnnotation(String referenceText, String noteText) #RtfRunAdds an annotation reference run with note text.
Parameters
- referenceText System.String
- noteText System.String
public RtfBookmarkMarker AddBookmarkEnd(String name) #RtfBookmarkMarkerAdds a bookmark end marker at the current paragraph position.
Parameters
- name System.String
public RtfBookmarkMarker AddBookmarkStart(String name) #RtfBookmarkMarkerAdds a bookmark start marker at the current paragraph position.
Parameters
- name System.String
public RtfBreak AddBreak(RtfBreakKind kind) #RtfBreakAdds an explicit break at the current paragraph position.
Parameters
- kind OfficeIMO.Rtf.RtfBreakKind
public RtfBreak AddColumnBreak() #RtfBreakAdds a column break at the current paragraph position.
public RtfGeneratedText AddCurrentDate(String fallbackText = null) #RtfGeneratedTextAdds a generated current date marker.
Parameters
- fallbackText System.String = null
public RtfGeneratedText AddCurrentDateAbbreviated(String fallbackText = null) #RtfGeneratedTextAdds a generated current date marker in abbreviated format.
Parameters
- fallbackText System.String = null
public RtfGeneratedText AddCurrentDateLong(String fallbackText = null) #RtfGeneratedTextAdds a generated current date marker in long format.
Parameters
- fallbackText System.String = null
public RtfGeneratedText AddCurrentTime(String fallbackText = null) #RtfGeneratedTextAdds a generated current time marker.
Parameters
- fallbackText System.String = null
public RtfRun AddEndnote(String referenceText, String noteText) #RtfRunAdds a superscript endnote reference run with note text.
Parameters
- referenceText System.String
- noteText System.String
public RtfField AddEquationField(String equationInstruction, String resultText) #RtfFieldAdds a Word EQ equation field with cached visible fallback text.
Parameters
- equationInstruction System.String
- resultText System.String
public RtfField AddField(String instruction) #RtfFieldAdds an RTF field at the current paragraph position.
Parameters
- instruction System.String
public RtfRun AddFootnote(String referenceText, String noteText) #RtfRunAdds a superscript footnote reference run with note text.
Parameters
- referenceText System.String
- noteText System.String
public RtfGeneratedText AddGeneratedText(RtfGeneratedTextKind kind, String fallbackText = null) #RtfGeneratedTextAdds a generated text marker at the current paragraph position.
Parameters
- kind OfficeIMO.Rtf.RtfGeneratedTextKind
- fallbackText System.String = null
public RtfImage AddImage(RtfImageFormat format, Byte[] data) #RtfImageAdds a picture at the current paragraph position.
Parameters
- format OfficeIMO.Rtf.RtfImageFormat
- data System.Byte[]
public RtfBreak AddLineBreak() #RtfBreakAdds a line break at the current paragraph position.
public RtfGeneratedText AddNoteReference(RtfNote note, String fallbackText = null) #RtfGeneratedTextAdds an automatic note reference marker and attaches the supplied note to it.
Parameters
- note OfficeIMO.Rtf.RtfNote
- fallbackText System.String = null
public RtfObject AddObject(RtfObjectKind kind = Unknown, Byte[] data = null) #RtfObjectAdds an embedded or linked object at the current paragraph position.
Parameters
- kind OfficeIMO.Rtf.RtfObjectKind = Unknown
- data System.Byte[] = null
public RtfBreak AddPageBreak() #RtfBreakAdds a page break at the current paragraph position.
public RtfGeneratedText AddPageNumber(String fallbackText = null) #RtfGeneratedTextAdds a generated current page number marker.
Parameters
- fallbackText System.String = null
public RtfGeneratedText AddSectionNumber(String fallbackText = null) #RtfGeneratedTextAdds a generated current section number marker.
Parameters
- fallbackText System.String = null
public RtfShape AddShape() #RtfShapeAdds a drawing shape at the current paragraph position.
public RtfBreak AddSoftLineBreak() #RtfBreakAdds a soft line break at the current paragraph position.
public RtfBreak AddSoftPageBreak() #RtfBreakAdds a soft page break at the current paragraph position.
public RtfTabStop AddTabStop(Int32 positionTwips, RtfTabAlignment alignment = Left, RtfTabLeader leader = None) #RtfTabStopAdds a tab stop to the paragraph.
Parameters
- positionTwips System.Int32
- alignment OfficeIMO.Rtf.RtfTabAlignment = Left
- leader OfficeIMO.Rtf.RtfTabLeader = None
public Int32 ReplaceText(String oldText, String newText, StringComparison comparison = Ordinal) #Int32Replaces 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
- newText System.String
- comparison System.StringComparison = Ordinal
public RtfParagraph SetAdjustRightIndent(Nullable<Boolean> enabled = true) #RtfParagraphSets automatic right-indent adjustment for document-grid layouts.
Parameters
- enabled System.Nullable{System.Boolean} = true
public RtfParagraph SetAlignment(RtfTextAlignment alignment) #RtfParagraphSets paragraph alignment.
Parameters
- alignment OfficeIMO.Rtf.RtfTextAlignment
public RtfParagraph SetBackgroundColor(Nullable<Int32> colorIndex) #RtfParagraphSets paragraph background shading to a one-based color table index.
Parameters
- colorIndex System.Nullable{System.Int32}
public RtfParagraph SetBorder(RtfParagraphBorderSide side, RtfParagraphBorderStyle style, Nullable<Int32> width = null, Nullable<Int32> colorIndex = null) #RtfParagraphSets paragraph border formatting for one side.
Parameters
- side OfficeIMO.Rtf.RtfParagraphBorderSide
- style OfficeIMO.Rtf.RtfParagraphBorderStyle
- width System.Nullable{System.Int32} = null
- colorIndex System.Nullable{System.Int32} = null
public RtfParagraph SetContextualSpacing(Nullable<Boolean> enabled = true) #RtfParagraphSets contextual paragraph spacing.
Parameters
- enabled System.Nullable{System.Boolean} = true
public RtfParagraph SetDirection(Nullable<RtfTextDirection> direction) #RtfParagraphSets explicit paragraph text direction.
Parameters
- direction System.Nullable{OfficeIMO.Rtf.RtfTextDirection}
public RtfParagraph SetFrame(Action<RtfParagraphFrame> configure) #RtfParagraphConfigures absolute positioning frame metadata for this paragraph.
Parameters
- configure System.Action{OfficeIMO.Rtf.RtfParagraphFrame}
public RtfParagraph SetIndentation(Nullable<Int32> leftTwips = null, Nullable<Int32> rightTwips = null, Nullable<Int32> firstLineTwips = null) #RtfParagraphSets paragraph indentation in twips.
Parameters
- leftTwips System.Nullable{System.Int32} = null
- rightTwips System.Nullable{System.Int32} = null
- firstLineTwips System.Nullable{System.Int32} = null
public RtfParagraph SetLegacyNumbering(Action<RtfLegacyNumbering> configure) #RtfParagraphConfigures Word 6/95 legacy paragraph numbering metadata.
Parameters
- configure System.Action{OfficeIMO.Rtf.RtfLegacyNumbering}
public RtfParagraph SetLineSpacing(Nullable<Int32> lineSpacingTwips, Nullable<Boolean> multiple = null) #RtfParagraphSets raw RTF paragraph line spacing controls.
Parameters
- lineSpacingTwips System.Nullable{System.Int32}
- multiple System.Nullable{System.Boolean} = null
public RtfParagraph SetList(Int32 listId = 1, Int32 level = 0, RtfListKind kind = Bullet) #RtfParagraphMarks the paragraph as a list item.
Parameters
- listId System.Int32 = 1
- level System.Int32 = 0
- kind OfficeIMO.Rtf.RtfListKind = Bullet
public RtfParagraph SetListText(String text) #RtfParagraphSets plain fallback list marker text emitted in a \listtext destination.
Parameters
- text System.String
public RtfParagraph SetListText(Action<RtfParagraph> configure) #RtfParagraphConfigures rich fallback list marker content emitted in a \listtext destination.
Parameters
- configure System.Action{OfficeIMO.Rtf.RtfParagraph}
public RtfParagraph SetOutlineLevel(Nullable<Int32> outlineLevel) #RtfParagraphSets the paragraph outline level.
Parameters
- outlineLevel System.Nullable{System.Int32}
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) #RtfParagraphSets paragraph pagination controls.
Parameters
- pageBreakBefore System.Nullable{System.Boolean} = null
- keepWithNext System.Nullable{System.Boolean} = null
- keepLinesTogether System.Nullable{System.Boolean} = null
- widowControl System.Nullable{System.Boolean} = null
- suppressLineNumbers System.Nullable{System.Boolean} = null
- autoHyphenation System.Nullable{System.Boolean} = null
public RtfParagraph SetParagraphSpacing(Nullable<Int32> beforeTwips = null, Nullable<Int32> afterTwips = null, Nullable<Boolean> beforeAuto = null, Nullable<Boolean> afterAuto = null) #RtfParagraphSets paragraph spacing before and after this paragraph.
Parameters
- beforeTwips System.Nullable{System.Int32} = null
- afterTwips System.Nullable{System.Int32} = null
- beforeAuto System.Nullable{System.Boolean} = null
- afterAuto System.Nullable{System.Boolean} = null
public RtfParagraph SetRevisionSaveId(Nullable<Int32> id) #RtfParagraphSets the paragraph revision save identifier represented by \pararsid.
Parameters
- id System.Nullable{System.Int32}
public RtfParagraph SetShading(Nullable<Int32> backgroundColorIndex, Nullable<Int32> foregroundColorIndex = null, Nullable<Int32> patternPercent = null, RtfShadingPattern pattern = None) #RtfParagraphSets paragraph shading color and pattern metadata.
Parameters
- backgroundColorIndex System.Nullable{System.Int32}
- foregroundColorIndex System.Nullable{System.Int32} = null
- patternPercent System.Nullable{System.Int32} = null
- pattern OfficeIMO.Rtf.RtfShadingPattern = None
public RtfParagraph SetSnapToLineGrid(Nullable<Boolean> enabled = true) #RtfParagraphSets whether paragraph lines snap to the document line grid.
Parameters
- enabled System.Nullable{System.Boolean} = true
public RtfParagraph SetStyle(Int32 styleId) #RtfParagraphSets the paragraph style id.
Parameters
- styleId System.Int32
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
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.