
Research
/Security News
737 Chrome VPN Extensions Linked to Brand Impersonation and Browser Traffic Redirection
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.
docx2pdf-cli
Advanced tools
Honest, batch-aware DOCX to PDF CLI with hybrid backends (LibreOffice, Gotenberg, ConvertAPI, Pages, Word, textutil).
Honest, batch-aware DOCX → PDF converter with hybrid backends.
--why prints the full decision tree; no opaque "auto" mode that silently picks a low-fidelity fallback.UserInstallation profile dir, so parallel invocations don't deadlock on a shared profile.| docx2pdf-cli | libreoffice-convert | AlJohri/docx2pdf | Gotenberg | dxpdf | |
|---|---|---|---|---|---|
| Backend approach | hybrid (6) | LibreOffice | MS Word automation | LibreOffice (server) | native Skia renderer |
| Concurrency-safe LO | ✅ per-call profile | ❌ shared profile collision | n/a | ✅ | n/a |
| Batch CLI + NDJSON | ✅ | ❌ (library API only) | ❌ | n/a (HTTP server) | ❌ |
Backend transparency (--why) | ✅ | ❌ | ❌ | ❌ | ❌ |
| Font preflight | ✅ | ❌ | ❌ | ❌ | ❌ |
| Linux + macOS + Windows | ✅ | ✅ | macOS + Windows only | ✅ (Docker) | ✅ |
| Install | npm i -g | npm i | pip install | Docker | cargo install / pip |
Honest notes: libreoffice-convert is a leaner Node library API (we're a CLI). Gotenberg also handles HTML→PDF and scales as a server. dxpdf ships a custom renderer that avoids LibreOffice entirely (~100ms per doc) but is still feature-incomplete.
npm i -g docx2pdf-cli
Or from a clone:
git clone https://github.com/DrBaher/docx2pdf-cli.git
cd docx2pdf-cli && ./install.sh
You'll also need at least one backend's runtime — LibreOffice (brew install --cask libreoffice on macOS, apt install libreoffice on Debian/Ubuntu) is the easiest. Run docx2pdf --doctor to see what's available.
If you're wiring this into agents, use strict + machine-readable defaults:
docx2pdf --strict-fidelity --json --out-dir ./pdfs *.docx
--strict-fidelity prevents silent downgrade to text-only conversion.--json emits NDJSON in batch mode for robust parsing.--why is useful for audits/debugging backend choice.See AGENTS.md for default routing and fallback policy.
For deeper integration, see docs/AGENT_INTEGRATION.md, llms.txt, and examples/agent-defaults.json.
Machine-readable capabilities:
docx2pdf --capabilities
| Backend | Fidelity | Requires |
|---|---|---|
libreoffice | high (local) | soffice or lowriter |
gotenberg | high (server) | GOTENBERG_URL + curl |
convertapi | high (cloud) | CONVERTAPI_SECRET + curl |
pages | high (macOS) | Apple Pages, Automation permission |
word | high (macOS) | Microsoft Word, Automation permission |
textutil-cups | text-only | textutil + cupsfilter (macOS) |
auto selects the first available. Add --strict-fidelity to refuse the textutil-cups fallback when no high-fidelity backend is available.
docx2pdf input.docx output.pdf
export GOTENBERG_URL="http://127.0.0.1:3000"
docx2pdf --backend gotenberg input.docx output.pdf
export CONVERTAPI_SECRET="<your-secret>"
docx2pdf --backend convertapi input.docx output.pdf
docx2pdf --out-dir ./pdfs *.docx
docx2pdf --json --out-dir ./pdfs *.docx | jq
docx2pdf --concurrency 4 --out-dir ./pdfs *.docx # parallel, safe with LibreOffice
Globs are expanded by your shell on macOS/Linux. On Windows or with quoted patterns ("*.docx"), the CLI expands * and ? against the directory itself.
In batch mode, one bad file does not stop the rest. With --json, each file emits one NDJSON line:
{"ok":true,"backend":"libreoffice","input":"/abs/a.docx","output":"/abs/pdfs/a.pdf"}
{"ok":false,"input":"/abs/b.docx","error":"LibreOffice conversion failed: ..."}
Exit code is 0 only if every file succeeded.
docx2pdf --list-backends # which backends are usable on this machine
docx2pdf --doctor # full diagnostics as JSON
docx2pdf --why input.docx # print backend selection reasoning to stderr, then convert
docx2pdf --check-fonts input.docx # report which fonts in the document are missing
--check-fonts requires unzip and fc-list (install fontconfig on macOS via brew install fontconfig).
docker run --rm -p 3000:3000 gotenberg/gotenberg:8
--backend <auto|libreoffice|gotenberg|convertapi|pages|word|textutil-cups>
--strict-fidelity in auto mode, refuse to fall back to text-only backend
--out-dir <dir> write outputs to <dir>/<basename>.pdf (enables batch mode)
--concurrency <n> run up to N conversions in parallel in batch mode (default: 1)
--timeout-seconds <n> conversion timeout (default: 120)
--overwrite, --force replace existing output file
--quiet, -q suppress success output (errors still print)
--json emit machine-readable JSON (NDJSON in batch mode)
--why print backend selection reasoning to stderr
--check-fonts report which fonts in the .docx are missing
--list-backends show available backends and exit
--doctor print full diagnostics as JSON and exit
-h, --help
-v, --version
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Usage / bad arguments |
| 3 | Required backend or tool unavailable |
| 4 | Conversion failed |
MIT — see LICENSE.
FAQs
Honest, batch-aware DOCX to PDF CLI with hybrid backends (LibreOffice, Gotenberg, ConvertAPI, Pages, Word, textutil). Part of the contract-ops CLI suite.
The npm package docx2pdf-cli receives a total of 121 weekly downloads. As such, docx2pdf-cli popularity was classified as not popular.
We found that docx2pdf-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.