LogoPear Docs

bare-collabora

Collabora bindings for Bare

stable

bare-collabora — Collabora bindings for Bare. It is a native addon.

npm i bare-collabora

Usage

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

ParameterTypeDefaultDescription
urlstringA local file path or file: URL pointing to a document in any format supported by Collabora.

Throws

  • The document at url cannot 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

ParameterTypeDefaultDescription
urlstringThe destination path or file: URL to write to.
format?stringThe output format; when omitted, it is inferred from the extension of url.
options?stringA 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

On this page