Documentation
¶
Overview ¶
Package officecmd reads the command line an app hands the office engine.
Until filex 0.50 the office engine was LibreOffice, and an app ran it the way one runs soffice: `--convert-to <format>[:<filter>[:<options>]] <file>`. Since 0.50 the office engine is the OnlyOffice Document Server filex is connected to, and filex reads that same command line as a conversion: the target format, PDF/A when LibreOffice's PDF options ask for it, the CSV separator and character set when its CSV options name them. An app built for LibreOffice runs unchanged; a new app writes the same line.
The host (internal/wasmplugin) and the test host (plugintest) both read it here, so an app's tests refuse exactly what filex refuses.
Index ¶
Constants ¶
const ( Engine = "office" LegacyEngine = "libreoffice" )
The office engine's names: Engine since 0.50, LegacyEngine (its name while it was LibreOffice) still accepted for the same engine - the permission `engines:libreoffice` grants `engines:office` and the other way round.
Variables ¶
This section is empty.
Functions ¶
func OutputName ¶
OutputName is the name a result gets: the input's stem and the target extension, the name soffice gave it (`in.docx` → `in.pdf`).
Types ¶
type Command ¶
type Command struct {
// To is the target format, an extension ("pdf", "docx", "csv").
To string
// PDFA: LibreOffice's PDF options asked for a PDF/A version (1, 2 or 3).
// The document server makes one kind of PDF/A (PDF/A-2a on 9.4).
PDFA bool
// Delimiter and CodePage are the conversion API's CSV knobs, read from
// LibreOffice's CSV options (0 = not said).
Delimiter int
CodePage int
// Inputs are the files to convert, by their names in the run directory.
Inputs []string
}
Command is a command line read as a conversion.
func Parse ¶
Parse reads a command line. The error says what is wrong in a sentence an app's author can act on.
func (*Command) OutputType ¶
OutputType is what the document server is asked to make: To, or "pdfa".