Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OdfTextContent

Namespace OfficeIMO.OpenDocument
Assembly OfficeIMO.OpenDocument
Modifiers abstract

Native ODF paragraph or inline content. Edits stay in the owning document XML.

Inheritance

  • Object
  • OdfTextContent

Methods

public OdfTextField AddField(OdfTextFieldKind kind, String displayText = null) #
Returns: OdfTextField

Appends a basic native field with cached display text.

Parameters

kind OfficeIMO.OpenDocument.OdfTextFieldKind requiredposition: 0
displayText System.String = null optionalposition: 1
public OdfTextRun AddRun(String text = null) #
Returns: OdfTextRun

Appends a styled run, retaining existing nodes.

Parameters

text System.String = null optionalposition: 0
public Void AddText(String text) #
Returns: Void

Appends text using ODF space, tab, and line-break encoding.

Parameters

text System.String requiredposition: 0
public XElement ToXml() #
Returns: XElement

Returns a detached copy of this native element.

public Void TransformTextCase(OfficeTextCase textCase, CultureInfo culture = null) #
Returns: Void

Transforms stored text while retaining inline XML and excluding annotations and embedded objects.

Parameters

textCase OfficeIMO.Drawing.OfficeTextCase requiredposition: 0
culture System.Globalization.CultureInfo = null optionalposition: 1

Properties

public String Text { get; set; } #

Decoded text. Assignment replaces this element's child content, including nested formatting and fields.

public String StyleName { get; set; } #

Referenced native style name.

public IReadOnlyList<OdfTextNode> InlineNodes { get; } #

Ordered inline syntax. Text values are snapshots; typed wrappers edit the original XML.

public IReadOnlyList<OdfTextRun> Runs { get; } #

Styled runs in this content's text story, including nested runs.

public IReadOnlyList<OdfTextField> Fields { get; } #

Basic page, date, and time fields in this content's text story.

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

Effective bold state, including inline, paragraph, and graphic inheritance.

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

Effective italic state.

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

Effective underline state.

public Nullable<OdfTextDecorationStyle> UnderlineStyle { get; set; } #

Effective native underline style.

public Nullable<OdfTextDecorationType> UnderlineType { get; set; } #

Effective native underline line count.

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

Effective strike-through state.

public Nullable<OdfLength> FontSize { get; set; } #

Effective font size.

public String FontFamily { get; set; } #

Effective font family.

public Nullable<OdfColor> Color { get; set; } #

Effective text color.

public Nullable<Double> TextOpacity { get; set; } #

Effective text opacity from zero to one, including inline, paragraph and graphic inheritance.

Exceptions

  • InvalidDataException – The nearest imported opacity declaration is invalid or its aliases conflict.
  • ArgumentOutOfRangeException – The assigned value is not finite or is outside zero to one.
public Nullable<OdfColor> BackgroundColor { get; set; } #

Effective text background. An explicit transparent override stops inheritance.

public Nullable<OdfTextPosition> TextPosition { get; set; } #

Effective baseline placement.

public Nullable<OdfTextTransform> TextTransform { get; set; } #

Effective display-time case transformation.

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

Effective small-cap formatting.