Skip to main content

oxidocs

Convert .docx to PDF in Python without LibreOffice or Microsoft Word.

pip install oxidocs
import oxidocs

result = oxidocs.docx_to_pdf("report.docx", "report.pdf")
print(result.pages)

The package bundles the Oxi engine as a single binary. Oxi is an open-source Rust engine that lays out Word documents the way Word does. There is no office suite to install and no server to run. The document is converted on the machine that holds it.

Many documents

A Converter keeps one engine process running and can be shared between threads:

with oxidocs.Converter(threads=4) as converter:
    for name in names:
        converter.convert(f"{name}.docx", f"{name}.pdf")

Knowing when to fall back

With strict=True, a document that holds content Oxi does not draw raises UnsupportedContent instead of producing an incomplete PDF. Examples are a chart type it does not support, or SmartArt saved without its drawing. The same applies when Oxi's pages would show less than 90% of the document's own text. You can then hand that document to another converter:

try:
    oxidocs.docx_to_pdf(src, dst, strict=True)
except oxidocs.UnsupportedContent as e:
    print("falling back:", e.kinds)   # e.g. ['chart']
    convert_with_libreoffice(src, dst)

ConversionError (the base class) covers files that cannot be read at all.

Command line

Installing the package also puts the oxidocs command on your PATH:

oxidocs docx-to-pdf report.docx report.pdf
oxidocs docx-to-pdf --strict report.docx report.pdf   # exit status 3 on content Oxi does not draw

python -m oxidocs ... runs the same command. The OXIDOCS_BINARY environment variable points the package at another oxidocs binary.

How faithful is it?

We froze 50 English and 50 Japanese documents from the public docx-corpus before any engine rendered them. Each was converted by this engine and by LibreOffice 26.8.2.2 on the same Linux machine, and both outputs were scored against Microsoft Word's own PDF of the same file.

English SSIM page count matches Word Japanese SSIM page count matches Word
Oxi 0.884 47 / 50 0.797 45 / 50
LibreOffice 0.841 39 / 50 0.769 26 / 50

Over 4,988 documents, the median conversion took 0.08 s, against 0.89 s for LibreOffice. The method and the full tables are in integrations/gotenberg.

Fonts: Oxi does not bundle Microsoft fonts. It lays text out with metrics measured from Word's fonts and draws it with metric-compatible open fonts. Line and page breaks therefore do not depend on which fonts the machine has installed, but the glyph shapes differ from Microsoft's.

License

The bundled oxidocs binary is the Oxi engine under MPL-2.0. This package's Python code is MIT OR Apache-2.0.

Metadata

Release files for oxidocs 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for oxidocs 0.9.0
File Actions
oxidocs-0.9.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for oxidocs-0.9.0-py3-none-win_amd64.whl
oxidocs-0.9.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for oxidocs-0.9.0-py3-none-manylinux_2_28_x86_64.whl
oxidocs-0.9.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for oxidocs-0.9.0-py3-none-manylinux_2_28_aarch64.whl
oxidocs-0.9.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for oxidocs-0.9.0-py3-none-macosx_11_0_arm64.whl
oxidocs-0.9.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for oxidocs-0.9.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 261.8 MB

Release files / oxidocs-0.9.0-py3-none-win_amd64.whl

Download URL oxidocs-0.9.0-py3-none-win_amd64.whl
Size 52.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
66fc419b227622f857b2e8f6045af293f84447af1b78f82173890d222842eb5f
BLAKE2b-256 checksum
How to use checksums
44434daa3bebcb9e2e45082691ddeb98d261cf5d1c90596bd4971dfb869ff5d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / oxidocs-0.9.0-py3-none-manylinux_2_28_x86_64.whl

Download URL oxidocs-0.9.0-py3-none-manylinux_2_28_x86_64.whl
Size 52.5 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
8c5743b0fd3a36b36e1d09c02dff1e9d3c9ce85823c92ac09a17271acaeb3ac3
BLAKE2b-256 checksum
How to use checksums
59bb1c77d2adcf99567e91b5e4a522558b9fc511f4c30b875742ba03211bd00a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / oxidocs-0.9.0-py3-none-manylinux_2_28_aarch64.whl

Download URL oxidocs-0.9.0-py3-none-manylinux_2_28_aarch64.whl
Size 52.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
7299e805f28fc3fe68c81448e25ca717d2dcd3b13b2374b1defdd07608953436
BLAKE2b-256 checksum
How to use checksums
8df7f48ee7e26a6b628891974905f622815c49a1b28e3e7967e17607f2478fed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / oxidocs-0.9.0-py3-none-macosx_11_0_arm64.whl

Download URL oxidocs-0.9.0-py3-none-macosx_11_0_arm64.whl
Size 52.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
926c065577583b5cda3bd385c2aa653e27efdc8c6f401684ab70d48420bd7cdf
BLAKE2b-256 checksum
How to use checksums
faf91183fcc79e14816311812f8434477e89f492fa82cd56979eeda00b52bcc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / oxidocs-0.9.0-py3-none-macosx_10_12_x86_64.whl

Download URL oxidocs-0.9.0-py3-none-macosx_10_12_x86_64.whl
Size 52.3 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
19fb83808e7bda3ae7940ea712529f58f4b78c4dd92d5d1eaacec104ee0f46df
BLAKE2b-256 checksum
How to use checksums
86762446af7629543a1187b70e1ec0cec7dfd2d040ea44fc662392a8d367dbf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for oxidocs 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for oxidocs-0.9.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page