RtfParagraph
OfficeIMO.Rtf
Paragraph in an RTF document.
Inheritance
- object
- RtfParagraph
Usage
Explore 41 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 36
- 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.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 5
- 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) #Adds an annotation reference run with note text.
Parameters
- referenceText string
- noteText string
Returns
RtfRunpublic RtfBookmarkMarker AddBookmarkEnd(string name) #Adds a bookmark end marker at the current paragraph position.
Parameters
- name string
Returns
RtfBookmarkMarkerpublic RtfBookmarkMarker AddBookmarkStart(string name) #Adds a bookmark start marker at the current paragraph position.
Parameters
- name string
Returns
RtfBookmarkMarkerpublic RtfBreak AddBreak(RtfBreakKind kind) #Adds an explicit break at the current paragraph position.
Parameters
- kind OfficeIMO.Rtf.RtfBreakKind
Returns
RtfBreakpublic RtfBreak AddColumnBreak() #Adds a column break at the current paragraph position.
Returns
RtfBreakpublic RtfGeneratedText AddCurrentDate(string? fallbackText = null) #Adds a generated current date marker.
Parameters
- fallbackText string? = null
Returns
RtfGeneratedTextpublic RtfGeneratedText AddCurrentDateAbbreviated(string? fallbackText = null) #Adds a generated current date marker in abbreviated format.
Parameters
- fallbackText string? = null
Returns
RtfGeneratedTextpublic RtfGeneratedText AddCurrentDateLong(string? fallbackText = null) #Adds a generated current date marker in long format.
Parameters
- fallbackText string? = null
Returns
RtfGeneratedTextpublic RtfGeneratedText AddCurrentTime(string? fallbackText = null) #Adds a generated current time marker.
Parameters
- fallbackText string? = null
Returns
RtfGeneratedTextpublic RtfRun AddEndnote(string referenceText, string noteText) #Adds a superscript endnote reference run with note text.
Parameters
- referenceText string
- noteText string
Returns
RtfRunpublic RtfField AddEquationField(string equationInstruction, string resultText) #Adds a Word EQ equation field with cached visible fallback text.
Parameters
- equationInstruction string
- resultText string
Returns
RtfFieldpublic RtfField AddField(string instruction) #Adds an RTF field at the current paragraph position.
Parameters
- instruction string
Returns
RtfFieldpublic RtfRun AddFootnote(string referenceText, string noteText) #Adds a superscript footnote reference run with note text.
Parameters
- referenceText string
- noteText string
Returns
RtfRunpublic RtfGeneratedText AddGeneratedText(RtfGeneratedTextKind kind, string? fallbackText = null) #Adds a generated text marker at the current paragraph position.
Parameters
- kind OfficeIMO.Rtf.RtfGeneratedTextKind
- fallbackText string? = null
Returns
RtfGeneratedTextpublic RtfImage AddImage(RtfImageFormat format, byte[] data) #Adds a picture at the current paragraph position.
Parameters
- format OfficeIMO.Rtf.RtfImageFormat
- data byte[]
Returns
RtfImagepublic RtfGeneratedText AddNoteReference(RtfNote note, string? fallbackText = null) #Adds an automatic note reference marker and attaches the supplied note to it.
Parameters
- note OfficeIMO.Rtf.RtfNote
- fallbackText string? = null
Returns
RtfGeneratedTextpublic RtfObject AddObject(RtfObjectKind kind = Unknown, byte[]? data = null) #Adds an embedded or linked object at the current paragraph position.
Parameters
- kind OfficeIMO.Rtf.RtfObjectKind = Unknown
- data byte[]? = null
Returns
RtfObjectpublic RtfGeneratedText AddPageNumber(string? fallbackText = null) #Adds a generated current page number marker.
Parameters
- fallbackText string? = null
Returns
RtfGeneratedTextpublic RtfGeneratedText AddSectionNumber(string? fallbackText = null) #Adds a generated current section number marker.
Parameters
- fallbackText string? = null
Returns
RtfGeneratedTextpublic RtfBreak AddSoftLineBreak() #Adds a soft line break at the current paragraph position.
Returns
RtfBreakpublic RtfBreak AddSoftPageBreak() #Adds a soft page break at the current paragraph position.
Returns
RtfBreakpublic RtfTabStop AddTabStop(int positionTwips, RtfTabAlignment alignment = Left, RtfTabLeader leader = None) #Adds a tab stop to the paragraph.
Parameters
- positionTwips int
- alignment OfficeIMO.Rtf.RtfTabAlignment = Left
- leader OfficeIMO.Rtf.RtfTabLeader = None
Returns
RtfTabStoppublic int ReplaceText(string oldText, string newText, StringComparison comparison = Ordinal) #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 string
- newText string
- comparison System.StringComparison = Ordinal
Returns
intpublic RtfParagraph SetAdjustRightIndent(bool? enabled = true) #Sets automatic right-indent adjustment for document-grid layouts.
Parameters
- enabled bool? = true
Returns
RtfParagraphpublic RtfParagraph SetAlignment(RtfTextAlignment alignment) #Sets paragraph alignment.
Parameters
- alignment OfficeIMO.Rtf.RtfTextAlignment
Returns
RtfParagraphpublic RtfParagraph SetBackgroundColor(int? colorIndex) #Sets paragraph background shading to a one-based color table index.
Parameters
- colorIndex int?
Returns
RtfParagraphpublic RtfParagraph SetBorder(RtfParagraphBorderSide side, RtfParagraphBorderStyle style, int? width = null, int? colorIndex = null) #Sets paragraph border formatting for one side.
Parameters
- side OfficeIMO.Rtf.RtfParagraphBorderSide
- style OfficeIMO.Rtf.RtfParagraphBorderStyle
- width int? = null
- colorIndex int? = null
Returns
RtfParagraphpublic RtfParagraph SetContextualSpacing(bool? enabled = true) #Sets contextual paragraph spacing.
Parameters
- enabled bool? = true
Returns
RtfParagraphpublic RtfParagraph SetDirection(RtfTextDirection? direction) #Sets explicit paragraph text direction.
Parameters
- direction OfficeIMO.Rtf.RtfTextDirection?
Returns
RtfParagraphpublic RtfParagraph SetFrame(Action<RtfParagraphFrame> configure) #Configures absolute positioning frame metadata for this paragraph.
Parameters
- configure System.Action<OfficeIMO.Rtf.RtfParagraphFrame>
Returns
RtfParagraphpublic RtfParagraph SetIndentation(int? leftTwips = null, int? rightTwips = null, int? firstLineTwips = null) #Sets paragraph indentation in twips.
Parameters
- leftTwips int? = null
- rightTwips int? = null
- firstLineTwips int? = null
Returns
RtfParagraphpublic RtfParagraph SetLegacyNumbering(Action<RtfLegacyNumbering> configure) #Configures Word 6/95 legacy paragraph numbering metadata.
Parameters
- configure System.Action<OfficeIMO.Rtf.RtfLegacyNumbering>
Returns
RtfParagraphpublic RtfParagraph SetLineSpacing(int? lineSpacingTwips, bool? multiple = null) #Sets raw RTF paragraph line spacing controls.
Parameters
- lineSpacingTwips int?
- multiple bool? = null
Returns
RtfParagraphpublic RtfParagraph SetList(int listId = 1, int level = 0, RtfListKind kind = Bullet) #Marks the paragraph as a list item.
Parameters
- listId int = 1
- level int = 0
- kind OfficeIMO.Rtf.RtfListKind = Bullet
Returns
RtfParagraphpublic RtfParagraph SetListText(string text) #Sets plain fallback list marker text emitted in a \listtext destination.
Parameters
- text string
Returns
RtfParagraphpublic RtfParagraph SetListText(Action<RtfParagraph> configure) #Configures rich fallback list marker content emitted in a \listtext destination.
Parameters
- configure System.Action<OfficeIMO.Rtf.RtfParagraph>
Returns
RtfParagraphpublic RtfParagraph SetOutlineLevel(int? outlineLevel) #Sets the paragraph outline level.
Parameters
- outlineLevel int?
Returns
RtfParagraphpublic RtfParagraph SetPagination(bool? pageBreakBefore = null, bool? keepWithNext = null, bool? keepLinesTogether = null, bool? widowControl = null, bool? suppressLineNumbers = null, bool? autoHyphenation = null) #Sets paragraph pagination controls.
Parameters
- pageBreakBefore bool? = null
- keepWithNext bool? = null
- keepLinesTogether bool? = null
- widowControl bool? = null
- suppressLineNumbers bool? = null
- autoHyphenation bool? = null
Returns
RtfParagraphpublic RtfParagraph SetParagraphSpacing(int? beforeTwips = null, int? afterTwips = null, bool? beforeAuto = null, bool? afterAuto = null) #Sets paragraph spacing before and after this paragraph.
Parameters
- beforeTwips int? = null
- afterTwips int? = null
- beforeAuto bool? = null
- afterAuto bool? = null
Returns
RtfParagraphpublic RtfParagraph SetRevisionSaveId(int? id) #Sets the paragraph revision save identifier represented by \pararsid.
Parameters
- id int?
Returns
RtfParagraphpublic RtfParagraph SetShading(int? backgroundColorIndex, int? foregroundColorIndex = null, int? patternPercent = null, RtfShadingPattern pattern = None) #Sets paragraph shading color and pattern metadata.
Parameters
- backgroundColorIndex int?
- foregroundColorIndex int? = null
- patternPercent int? = null
- pattern OfficeIMO.Rtf.RtfShadingPattern = None
Returns
RtfParagraphpublic RtfParagraph SetSnapToLineGrid(bool? enabled = true) #Sets whether paragraph lines snap to the document line grid.
Parameters
- enabled bool? = true
Returns
RtfParagraphpublic RtfParagraph SetStyle(int styleId) #Sets the paragraph style id.
Parameters
- styleId int
Returns
RtfParagraphInherited Methods
Properties
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? DirectAlignment { get; set; } #Authored Alignment override. Null inherits from the selected style; an explicit default clears that style value.
public RtfTextDirection? Direction { get; set; } #Explicit paragraph text direction represented by \ltrpar or \rtlpar.
public int? ListId { get; set; } #Optional list id for paragraphs bound to an RTF list override.
public int? ListDefinitionId { get; set; } #Optional list definition id resolved through the list override table.
public RtfLegacyNumbering LegacyNumbering { get; private set; } #Word 6/95 legacy paragraph numbering metadata from \pn* controls.
public RtfParagraph? ListText { get; private set; } #Word list marker fallback text represented by a paragraph-level \listtext destination.
public bool? SpaceBeforeAuto { get; set; } #Whether space before the paragraph is automatically determined by the renderer.
public bool? SpaceAfterAuto { get; set; } #Whether space after the paragraph is automatically determined by the renderer.
public bool? LineSpacingMultiple { get; set; } #Whether \sl is interpreted as multiple line spacing by \slmult. Null means not specified.
public int? BackgroundColorIndex { get; set; } #One-based color table index used by paragraph background shading.
public int? ShadingForegroundColorIndex { get; set; } #One-based color table index used by paragraph pattern foreground shading.
public int? ShadingPatternPercent { get; set; } #Raw RTF \shading value, where 10000 represents 100 percent.
public RtfParagraphBorder LeftBorder { get; private set; } #Left paragraph border.
public RtfParagraphBorder BottomBorder { get; private set; } #Bottom paragraph border.
public RtfParagraphBorder RightBorder { get; private set; } #Right paragraph border.
public bool PageBreakBefore { get; set; } #Whether a page break should be emitted before this paragraph.
public bool? DirectPageBreakBefore { get; set; } #Authored PageBreakBefore override. Null inherits from the selected style; an explicit default clears that style value.
public bool KeepWithNext { get; set; } #Whether this paragraph should stay on the same page as the following paragraph.
public bool? DirectKeepWithNext { get; set; } #Authored KeepWithNext override. Null inherits from the selected style; an explicit default clears that style value.
public bool KeepLinesTogether { get; set; } #Whether all lines in this paragraph should stay together on the same page.
public bool? DirectKeepLinesTogether { get; set; } #Authored KeepLinesTogether override. Null inherits from the selected style; an explicit default clears that style value.
public bool SuppressLineNumbers { get; set; } #Whether line numbering is suppressed for this paragraph.
public bool? DirectSuppressLineNumbers { get; set; } #Authored SuppressLineNumbers override. Null inherits from the selected style; an explicit default clears that style value.
public bool? AutoHyphenation { get; set; } #Paragraph-level automatic hyphenation override represented by \hyphpar.
public bool? ContextualSpacing { get; set; } #Whether contextual paragraph spacing is explicitly enabled or disabled.
public bool? AdjustRightIndent { get; set; } #Whether the right indent is automatically adjusted when a document grid is defined.
public bool? SnapToLineGrid { get; set; } #Whether paragraph lines snap to the document line grid.
public bool? WidowControl { get; set; } #Explicit paragraph widow/orphan control. Null means not specified.
public int? RevisionSaveId { get; set; } #Paragraph revision save identifier represented by \pararsid.
public RtfParagraphFrame Frame { get; private set; } #Absolute positioning, text wrapping, and drop-cap metadata for this paragraph.