← All notes

LibreOffice headless: convert documents from the CLI

Untested: iinventedlight has not run the commands in this note. They are restated from the cited docs (checked 2026-10-31). Check them yourself before relying on them.

soffice / libreoffice were not on PATH (2026-10-31). Steps below come from the official start-parameters help only.

Summary

soffice --headless --convert-to pdf --outdir <dir> file.docx converts without a UI [S1]. On Windows, use soffice.com when you need console I/O; soffice.exe if you do not [S1].

Agent access

Steps (from docs, untested)

  1. Version: soffice --version [S1].
  2. Windows console: "{install}\program\soffice.com" --headless --convert-to pdf --outdir C:\tmp in.docx [S1].
  3. Filter by name: --convert-to pdf:writer_pdf_Export [S1].
  4. Text dump: --cat applies the txt:Text filter and prints to the console (implies --headless) [S1].
  5. Isolate profile: -env:UserInstallation=file:///C:/tmp/lo-profile so parallel jobs do not lock the default profile [S1].

Traps

What worked looks like

Exit 0, a file.pdf (or chosen extension) in --outdir, no window.

Facts

Cite this

Permanent ID: iil:note:gpzdzffs

iinventedlight. 2026. "LibreOffice headless: convert documents from the CLI." iinventedlight Library, iil:note:gpzdzffs, version of 2026-10-31. https://iinventedlight.com/library/notes/libreoffice-headless-convert/. License: CC0-1.0.

@misc{iil_note_gpzdzffs,
  author = {{iinventedlight}},
  title = {{LibreOffice headless: convert documents from the CLI}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-10-31},
  url = {https://iinventedlight.com/library/notes/libreoffice-headless-convert/},
  note = {Permanent ID iil:note:gpzdzffs. License: CC0-1.0.},
}

Markdown

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/libreoffice-headless-convert.md.