WolfSDK - LibreOffice alternative
A LibreOffice headless alternative for Python and agent pipelines
Many pipelines shell out to soffice --headless --convert-to pdf and then to pdftoppm for page images. The wolf command covers that path for Word, PowerPoint, Excel, and PDF files with two verbs, and it accepts the same command lines through documented shims. Anything outside the documented forms fails with a named error and a non-zero exit.
Replace the two calls
A typical LibreOffice and Poppler pipeline:
import subprocess
subprocess.run(
["soffice", "--headless", "--convert-to", "pdf", "--outdir", "out", "report.docx"],
check=True,
)
subprocess.run(["pdftoppm", "-png", "-r", "150", "out/report.pdf", "out/report"], check=True)
# out/report.pdf, out/report-1.png, out/report-2.png, ...The same pipeline with wolf:
import subprocess
subprocess.run(["wolf", "render", "report.docx", "--to", "pdf", "--outdir", "out"], check=True)
subprocess.run(["wolf", "rasterize", "out/report.pdf", "--dpi", "150", "--outdir", "out"], check=True)
# out/report.pdf, out/report-1.png, out/report-2.png, ... and out/render-report.json
# check=True raises on exit code 1 (partial output); read the render report to see the losseswolf render reads DOCX, XLSX, PPTX, PDF, ODT, ODS, ODP, DOC, XLS, and PPT files and writes PDF, PNG, SVG, JPEG, TIFF, or BMP. Page images are named <stem>-<n>.png with the page number padded to the width of the page count, as pdftoppm does. To skip the PDF, render straight to images:
wolf render report.docx --to png --outdir out --dpi 150Every run writes a JSON receipt and a render report. The receipt records input and output digests, the status, and the exit category. The render report names each omission, approximation, and font substitution with a location, a reason, and a severity. The DOCX guide and the PPTX guide show a Python wrapper that reads both.
Keep your command lines
When a script or an agent skill already calls soffice, pdftoppm, pdftotext, pdfinfo, or pdfimages, run the wolf binary under those names and put that directory first on PATH:
export PATH="$PWD/wolf-shims:$PATH" # a directory whose soffice, pdftoppm, and pdfinfo are links to wolf
soffice --headless --convert-to pdf --outdir out report.docx
pdftoppm -png -r 150 out/report.pdf out/report
pdfinfo out/report.pdfIf a caller hard-codes an executable directory, place the shims at that location instead.
What the shims accept
soffice --convert-totargetspdf,docx,pptx,xlsx,odt, andcsv, with or without a profile directory option. Support for each input and target pair depends on the build.pdftoppmwrites PNG, JPEG, and PPM pages, with the-r,-f,-l,-scale-to, and-singlefileforms.pdfinforeports the page count and page size.- Any other argument fails before anything is written. A target such as RTF stops with
soffice: unsupported option: --convert-to rtfand exit code 1. A shim never falls back to a real LibreOffice or Poppler binary, and a failed run removes the files it had written. - The shims run no arbitrary macros.
What changes when you switch
- The layout engine is different.Pagination and line breaks can differ from LibreOffice's, so compare the output on your own documents. The published rendering results state the corpus, the method, and the caveats.
- Fonts are explicit. The wolf command uses bundled fonts plus the folders you pass with
--font-dir. The shims default to system fonts, as LibreOffice and Poppler do, and read extra folders fromWOLF_FONT_DIRS. Pin fonts when you need repeatable output. - Losses are reported. A shim run with omissions still exits 0, as the native tools do, and prints one line per output on standard error. Set
WOLF_REPORT_DIRto a directory and each shim run also writes a receipt and a render report there. - No profile directory. The documented bare form
soffice --headless --convert-to pdfcreates none.
When to keep LibreOffice
- You need a conversion target or an input format outside the lists above.
- Your workflow runs macros or edits documents interactively.
- Your output must match LibreOffice's layout exactly.
Wolf Runtime publishes its preservation, rendering, and image-size measurements with their methods on the Wolf Runtime page.
Get the wolf command
The wolf command ships with Wolf Runtime, which is licensed under a written Order. There is no pip package for it. The Wolf Runtime page lists the integration steps: select the build, install the shims or call the command directly, and run your own documents while you check the receipts, omissions, and refusals.