feat: add Oxi (oxidocs) converter for docx to pdf and png
Closes #707.
Adds Oxi (oxidocs) as a second converter for Word documents, next to LibreOffice:
src/converters/oxidocs.ts: docx, docm and dotx to pdf (oxidocs docx-to-pdf, the whole document) and png (oxidocs docx-to-png, the first page). Everything else stays with LibreOffice, which also stays the default for docx.- Its tests, the registry entry and its test, a
printVersionsline, the README row and the knip entry. - Dockerfile: downloads the static musl build (x86_64 or aarch64, fonts included) from the pinned release
oxidocs-v0.9.0-static.3, the same way as vtracer, and checks its SHA-256 before extracting.
The converter passes --quiet, so a successful conversion prints nothing; only warnings (for example a font with no file) and errors reach the log.
It also passes --strict: when a document holds content Oxi does not draw (ink drawings, for example), oxidocs writes no file and exits non-zero, so ConvertX reports the conversion as failed rather than returning a file with parts missing; LibreOffice can then be chosen instead.
Tested:
bun test tests/converters(284 pass) andbun run lintpass.- Built the image from this Dockerfile (x86_64) and, through the web routes (register, upload, convert, download), converted a docx to PDF and to PNG, both as root (the default) and with
PUID=1000. A document with ink drawings fails as described above, with no output file. The arm64 download path is not tested in an image build; the arm64 binary itself is built and smoke-tested on an ARM runner in Oxi's CI.
I maintain Oxi. This PR was written with AI assistance (Claude); I reviewed it and take responsibility for it.
Summary by cubic
Adds Oxi (oxidocs) as a second converter for Microsoft Office documents alongside LibreOffice, which stays the default. docx, docm, and dotx convert to PDF (whole document) or PNG (first page), pptx, pptm, and potx to PDF (every slide) or PNG (first slide), and xlsx, xlsm, xltx, and xltm to PDF (print areas of every visible sheet) or PNG (first printed page).
- Downloads the static musl build in the Dockerfile for x86_64 and aarch64 and runs
oxidocs fonts-indexto lay out its bundled fonts at build time, so they're present when the container runs with a non-rootPUID; the version is a Renovate-managed ARG at0.9.0-static.6. - Passes
--strict, so a document holding content Oxi can't draw fails instead of writing an incomplete file, and--quiet, so successful conversions print nothing.