Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OdtDocument

OfficeIMO.OpenDocument

Namespace
OfficeIMO.OpenDocument
Assembly
OfficeIMO.OpenDocument
Source revision
be6c300e4ab1 with working tree changes
Implements
IDisposable
Modifiers
sealed

Native OpenDocument Text document.

Inheritance

Usage

Explore 4 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 4

Methods

public bool AcceptTrackedChange(string id) #

Accepts one tracked insertion or deletion.

Parameters

id string required

Returns

bool
public OdtParagraph AddHeading(string text, int level = 1) #

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

Parameters

text string required
level int = 1 optional
public OdtList AddList(bool ordered = false) #

Adds an ordered or unordered list.

Parameters

ordered bool = false optional

Returns

OdtList
public OdtParagraph AddPageBreak() #

Adds an empty paragraph that starts on a new page.

public OdtParagraph AddParagraph(string? text = null) #

Adds a paragraph to the document body.

Parameters

text string? = null optional
public OdtSection AddSection(string name) #

Adds a named section to the document body.

Parameters

name string required

Returns

OdtSection
public OdtTable AddTable(int rows, int columns, string? name = null) #

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

Parameters

rows int required
columns int required
name string? = null optional

Returns

OdtTable
public OdtTrackedChange AddTrackedParagraphInsertion(string? text, string creator, DateTimeOffset? date = null) #

Appends a tracked paragraph insertion.

Parameters

text string? required
creator string required
date System.DateTimeOffset? = null optional
public static OdtDocument Create() #

Creates an empty ODF 1.4 text document.

public OdtTrackedChange DeleteParagraphTracked(OdtParagraph paragraph, string creator, DateTimeOffset? date = null) #

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

Parameters

paragraph OfficeIMO.OpenDocument.OdtParagraph required
creator string required
date System.DateTimeOffset? = null optional
Load 2 overloads
public static OdtDocument Load(string path, OdfLoadOptions? options = null) #

Loads an ODT document from a path.

Parameters

path string required
options OfficeIMO.OpenDocument.OdfLoadOptions? = null optional
public static OdtDocument Load(Stream stream, OdfLoadOptions? options = null) #

Loads an ODT document from a stream.

Parameters

stream System.IO.Stream required
options OfficeIMO.OpenDocument.OdfLoadOptions? = null optional
LoadAsync 2 overloads
public static async Task<OdtDocument> LoadAsync(string path, OdfLoadOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously loads an ODT document from a path.

Parameters

path string required
options OfficeIMO.OpenDocument.OdfLoadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<OdtDocument>
public static async Task<OdtDocument> LoadAsync(Stream stream, OdfLoadOptions? options = null, CancellationToken cancellationToken = default) #

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

Parameters

stream System.IO.Stream required
options OfficeIMO.OpenDocument.OdfLoadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<OdtDocument>
LoadFlatXml 2 overloads
public static OdtDocument LoadFlatXml(Stream stream, OdfLoadOptions? options = null) #

Loads a flat OpenDocument Text XML stream.

Parameters

stream System.IO.Stream required
options OfficeIMO.OpenDocument.OdfLoadOptions? = null optional
public static OdtDocument LoadFlatXml(string path, OdfLoadOptions? options = null) #

Loads a flat OpenDocument Text XML path.

Parameters

path string required
options OfficeIMO.OpenDocument.OdfLoadOptions? = null optional
public bool RejectTrackedChange(string id) #

Rejects one tracked insertion or deletion.

Parameters

id string required

Returns

bool

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<OdtHeaderFooter> HeaderFooters { get; } #

Existing header/footer stories across all authored masters, without creating a default layout or missing stories.

public IReadOnlyList<OdtTrackedChange> TrackedChanges { get; } #

Tracked changes declared by the document.