bare-collabora
Collabora bindings for Bare
stable
Source
Source
bare-collabora — Collabora bindings for Bare. It is a native addon.
npm i bare-collaboraUsage
const { Document } = require('bare-collabora')
const document = new Document('/path/to/sample.md')
document.saveAs('/path/to/sample.pdf')API
Document
new Document(url: string)
Source
Loads the document at url, a local file path or file: URL pointing to a document in any format supported by Collabora.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | — | A local file path or file: URL pointing to a document in any format supported by Collabora. |
Throws
- The document at
urlcannot be opened.
saveAs(url: string, format?: string, options?: string): boolean
Source
Saves the document to url in the given format. If format is omitted, it is inferred from the extension of url. options is a comma-separated string of filter options forwarded to Collabora; see the Collabora documentation for the filters available for a given format.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | — | The destination path or file: URL to write to. |
format? | string | — | The output format; when omitted, it is inferred from the extension of url. |
options? | string | — | A comma-separated string of filter options forwarded to Collabora. See the Collabora documentation for the filters available for a given format. |
Throws
- The document cannot be saved.
See also
- Bare modules — the full
bare-*catalog. - Bare runtime API — the runtime these modules extend.