API Reference

Class

OdtDocument

Namespace OfficeIMO.OpenDocument
Assembly OfficeIMO.OpenDocument
Modifiers sealed

Native OpenDocument Text document.

Inheritance

Usage

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

Methods

public Boolean AcceptTrackedChange(String id) #
Returns: Boolean

Accepts one tracked insertion or deletion.

Parameters

id System.String requiredposition: 0
public OdtParagraph AddHeading(String text, Int32 level = 1) #
Returns: OdtParagraph

Adds a heading with an outline level from 1 through 10.

Parameters

text System.String requiredposition: 0
level System.Int32 = 1 optionalposition: 1
public OdtList AddList(Boolean ordered = false) #
Returns: OdtList

Adds an ordered or unordered list.

Parameters

ordered System.Boolean = false optionalposition: 0
public OdtParagraph AddPageBreak() #
Returns: OdtParagraph

Adds an empty paragraph that starts on a new page.

public OdtParagraph AddParagraph(String text = null) #
Returns: OdtParagraph

Adds a paragraph to the document body.

Parameters

text System.String = null optionalposition: 0
public OdtSection AddSection(String name) #
Returns: OdtSection

Adds a named section to the document body.

Parameters

name System.String requiredposition: 0
public OdtTable AddTable(Int32 rows, Int32 columns, String name = null) #
Returns: OdtTable

Adds a table initialized with the requested row and column count.

Parameters

rows System.Int32 requiredposition: 0
columns System.Int32 requiredposition: 1
name System.String = null optionalposition: 2
public OdtTrackedChange AddTrackedParagraphInsertion(String text, String creator, Nullable<DateTimeOffset> date = null) #
Returns: OdtTrackedChange

Appends a tracked paragraph insertion.

Parameters

text System.String requiredposition: 0
creator System.String requiredposition: 1
date System.Nullable{System.DateTimeOffset} = null optionalposition: 2
public static OdtDocument Create() #
Returns: OdtDocument

Creates an empty ODF 1.4 text document.

public OdtTrackedChange DeleteParagraphTracked(OdtParagraph paragraph, String creator, Nullable<DateTimeOffset> date = null) #
Returns: OdtTrackedChange

Marks an existing top-level body paragraph or heading as deleted while retaining its XML in change metadata.

Parameters

paragraph OfficeIMO.OpenDocument.OdtParagraph requiredposition: 0
creator System.String requiredposition: 1
date System.Nullable{System.DateTimeOffset} = null optionalposition: 2
Load 2 overloads
public static OdtDocument Load(String path, OdfLoadOptions options = null) #
Returns: OdtDocument

Loads an ODT document from a path.

Parameters

path System.String requiredposition: 0
options OfficeIMO.OpenDocument.OdfLoadOptions = null optionalposition: 1
public static OdtDocument Load(Stream stream, OdfLoadOptions options = null) #
Returns: OdtDocument

Loads an ODT document from a stream.

Parameters

stream System.IO.Stream requiredposition: 0
options OfficeIMO.OpenDocument.OdfLoadOptions = null optionalposition: 1
LoadAsync 2 overloads
public static async Task<OdtDocument> LoadAsync(String path, OdfLoadOptions options = null, CancellationToken cancellationToken = null) #
Returns: Task<OdtDocument>

Asynchronously loads an ODT document from a path.

Parameters

path System.String requiredposition: 0
options OfficeIMO.OpenDocument.OdfLoadOptions = null optionalposition: 1
cancellationToken System.Threading.CancellationToken = null optionalposition: 2
public static async Task<OdtDocument> LoadAsync(Stream stream, OdfLoadOptions options = null, CancellationToken cancellationToken = null) #
Returns: Task<OdtDocument>

Asynchronously loads an ODT document from a caller-owned stream.

Parameters

stream System.IO.Stream requiredposition: 0
options OfficeIMO.OpenDocument.OdfLoadOptions = null optionalposition: 1
cancellationToken System.Threading.CancellationToken = null optionalposition: 2
LoadFlatXml 2 overloads
public static OdtDocument LoadFlatXml(Stream stream, OdfLoadOptions options = null) #
Returns: OdtDocument

Loads a flat OpenDocument Text XML stream.

Parameters

stream System.IO.Stream requiredposition: 0
options OfficeIMO.OpenDocument.OdfLoadOptions = null optionalposition: 1
public static OdtDocument LoadFlatXml(String path, OdfLoadOptions options = null) #
Returns: OdtDocument

Loads a flat OpenDocument Text XML path.

Parameters

path System.String requiredposition: 0
options OfficeIMO.OpenDocument.OdfLoadOptions = null optionalposition: 1
public Boolean RejectTrackedChange(String id) #
Returns: Boolean

Rejects one tracked insertion or deletion.

Parameters

id System.String requiredposition: 0

Properties

public IReadOnlyList<OdtParagraph> Paragraphs { get; } #

Paragraphs and headings in document body order.

public IReadOnlyList<OdtTable> Tables { get; } #

Top-level tables in the document body.

public IReadOnlyList<OdtList> Lists { get; } #

Top-level lists in the document body.

public IReadOnlyList<OdtSection> Sections { get; } #

Top-level named sections in the document body.

public IReadOnlyList<OdtContentBlock> ContentBlocks { get; } #

Paragraph, heading, and table blocks in reading order without duplicating table-cell paragraphs.

public OdtPageLayout PageLayout { get; } #

Page layout, margins, header, and footer through the first master page.

public IReadOnlyList<OdtTrackedChange> TrackedChanges { get; } #

Tracked changes declared by the document.