Table of Contents

Class Document

Namespace
LibreOfficeKit
Assembly
LibreOfficeKit.dll

Represents a loaded LibreOffice document. Provides methods for saving/converting the document and querying its type.

public sealed class Document : IDisposable
Inheritance
Document
Implements
Inherited Members

Methods

Dispose()

Releases native resources held by this document instance.

public void Dispose()

GetDocumentType()

Gets the document type (text, spreadsheet, presentation, drawing, or other).

public DocumentType GetDocumentType()

Returns

DocumentType

The DocumentType of this document.

SaveAs(string, SaveFormat, string?)

Saves the document using a SaveFormat enum value.

public bool SaveAs(string outputUrl, SaveFormat format, string? filterOptions = null)

Parameters

outputUrl string

The output file URL (file:// format).

format SaveFormat

The target SaveFormat.

filterOptions string

Optional filter options string.

Returns

bool

true if the save operation succeeded; otherwise false.

SaveAs(string, PdfOptions)

Saves the document as PDF using detailed PdfOptions.

public bool SaveAs(string outputUrl, PdfOptions options)

Parameters

outputUrl string

The output file URL (file:// format).

options PdfOptions

The PDF export options.

Returns

bool

true if the save operation succeeded; otherwise false.

SaveAs(string, string, string?)

Saves the document in another format using the native LOK saveAs function.

public bool SaveAs(string outputFile, string format, string? filterOptions = null)

Parameters

outputFile string

The output file path.

format string

The target format string (e.g. "pdf").

filterOptions string

Optional filter options string.

Returns

bool

true if the save operation succeeded; otherwise false.