Document

public final class Document implements AutoCloseable

Represents a document that can be opened, edited, and exported in various formats. Provides a unified interface for working with different document types including PDF, Word, Excel, and more.

Functions

Link copied to clipboard
public final void close()
Closes this resource and releases any associated native resources.
Link copied to clipboard
public final void export(FileOutputStream stream, IExporter exporter)
Exports the document to a stream using the specified exporter.
public final void export(String filepath, IExporter exporter)
Exports the document to a file using the specified exporter.
Link copied to clipboard
public final void exportAsHtml(FileOutputStream stream)
Exports the document as HTML format to the specified stream.
public final void exportAsHtml(String filepath)
Exports the document as HTML format to the specified file path.
Link copied to clipboard
public final void exportAsImage(FileOutputStream stream)
Exports the document as image format to the specified stream.
public final void exportAsImage(String filepath)
Exports the document as image format to the specified file path.
Link copied to clipboard
public final void exportAsMarkdown(FileOutputStream stream)
Exports the document as Markdown format to the specified stream.
public final void exportAsMarkdown(String filepath)
Exports the document as Markdown format to the specified file path.
Link copied to clipboard
public final void exportAsPdf(FileOutputStream stream)
Exports the document as PDF format to the specified stream.
public final void exportAsPdf(String filepath)
Exports the document as PDF format to the specified file path.
Link copied to clipboard
public final void exportAsPresentation(FileOutputStream stream)
Exports the document as presentation format to the specified stream.
public final void exportAsPresentation(String filepath)
Exports the document as presentation format to the specified file path.
Link copied to clipboard
public final void exportAsSpreadsheet(FileOutputStream stream)
Exports the document as spreadsheet format to the specified stream.
public final void exportAsSpreadsheet(String filepath)
Exports the document as spreadsheet format to the specified file path.
Link copied to clipboard
public final void exportAsSvg(FileOutputStream stream)
Exports the document as SVG format to the specified stream.
public final void exportAsSvg(String filepath)
Exports the document as SVG format to the specified file path.
Link copied to clipboard
public final void exportAsText(FileOutputStream stream)
Exports the document as Text format to the specified stream.
public final void exportAsText(String filepath)
Exports the document as Text format to the specified file path.
Link copied to clipboard
public final void exportAsWord(FileOutputStream stream)
Exports the document as Word format to the specified stream.
public final void exportAsWord(String filepath)
Exports the document as Word format to the specified file path.
Link copied to clipboard
public final int getPageCount()
The total number of pages in the document.
Link copied to clipboard
The settings associated with this document instance.
Link copied to clipboard
public final DocumentType getUnderlyingType()
The underlying document type (PDF, Word, Excel, etc.) of the opened document.
Link copied to clipboard
public final static Document open(FileInputStream stream)
Opens a document from a stream using default settings.
public final static Document open(String filePath)
Opens a document from a file path using default settings.
public final static Document open(FileInputStream stream, DocumentSettings settings)
Opens a document from a stream using specified settings.
public final static Document open(String filePath, DocumentSettings settings)
Opens a document from a file path using specified settings.