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
outputUrlstringThe output file URL (file:// format).
formatSaveFormatThe target SaveFormat.
filterOptionsstringOptional filter options string.
Returns
- bool
trueif the save operation succeeded; otherwisefalse.
SaveAs(string, PdfOptions)
Saves the document as PDF using detailed PdfOptions.
public bool SaveAs(string outputUrl, PdfOptions options)
Parameters
outputUrlstringThe output file URL (file:// format).
optionsPdfOptionsThe PDF export options.
Returns
- bool
trueif the save operation succeeded; otherwisefalse.
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
outputFilestringThe output file path.
formatstringThe target format string (e.g.
"pdf").filterOptionsstringOptional filter options string.
Returns
- bool
trueif the save operation succeeded; otherwisefalse.