Log InGet OrdStyle

Can I render a PDF without opening the editor?

Yes — `ordstyle --pdf report.ord` writes report.STYLE.pdf and exits, with no window. On a machine with no display — cron, a container, SSH — set `QT_QPA_PLATFORM=offscreen` first.

Every export the program makes from a menu — PDF, HTML, LibreOffice — it can also make from a command line, with no window. That is what makes a document buildable the same way code is.

ordstyle --pdf report.ord              # → report.STYLE.pdf
ordstyle --pdf report.ord SLIDES       # → report.SLIDES.pdf
ordstyle --html report.ord DARK        # → report.DARK.html

On a machine with no display at all — a cron job, a container, a server you reach over SSH — set QT_QPA_PLATFORM=offscreen in the environment first, or the program stops before it renders anything:

QT_QPA_PLATFORM=offscreen ordstyle --pdf report.ord

A style set name can follow the filename. Without one, the first set is used — which is why the first line gives report.STYLE.pdf rather than report.pdf: STYLE is the name of the set most documents start with.

The rendering options

Option Effect
--pdf Generate a PDF and exit
--html Generate HTML and exit
--fodt Generate a flat OpenDocument file, which LibreOffice Writer opens
--section <spec> Render only that section, e.g. 1 or 1.2
--html-assets <dir> Write images to a folder instead of inlining them
--fodt-static-toc Emit a fixed contents list rather than one Writer can regenerate

What this is good for

  • A nightly report rendered from data that changed during the day.
  • A document in version control, rebuilt by CI on every commit, so a bad edit shows up as a changed PDF rather than as a surprise at print time.
  • Rendering every style set in one pass — the printed edition and the deck — from one script, with no chance of one being stale.

Because a document is a plain text file, all of this diffs cleanly and belongs in the same repository as whatever it documents.

See also