Skip to main content

oxidocs

Convert .docx, .pptx and .xlsx to PDF in Python without LibreOffice or Microsoft Office.

pip install oxidocs
import oxidocs

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

oxidocs.pptx_to_pdf("deck.pptx", "deck.pdf")   # one page per slide
oxidocs.xlsx_to_pdf("report.xlsx", "report.pdf")  # visible sheets, in print order

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.

Presentations

pptx_to_pdf writes one PDF page per slide, with text laid out by rules measured from PowerPoint. Slides are newer in Oxi than Word documents, and some content is not drawn as PowerPoint draws it yet: charts, gradient fills (drawn in one colour), dashed outlines (drawn solid), rotated text and pictures, and text warps. strict=True raises UnsupportedContent for a deck that holds any of these, as it does for documents:

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

A Converter takes documents, presentations and spreadsheets alike.

Spreadsheets

xlsx_to_pdf exports visible worksheets in workbook order. It supports cell text (including Japanese), saved formula results, number formats, solid backgrounds, simple borders, alignment, wrapping, shrink-to-fit, merged cells and hidden rows and columns. Printing uses each sheet's cell-range print areas, Letter/Legal/A3/A4/A5 paper size, orientation, margins, scale, fit-to-page settings, centering and manual page breaks. Separate print areas start on separate pages. Empty sheets are skipped.

oxidocs.xlsx_to_pdf("report.xlsx", "report.pdf", strict=True)

The engine does not recalculate formulas or run VBA; save updated calculation results before conversion. Macro-enabled workbooks (.xlsm) are accepted too. This first spreadsheet PDF path does not establish Excel print-layout parity: row heights use the saved values and unwrapped text is clipped to its cell. Drawings/charts, table styles, conditional formatting, rich or rotated text, complex borders, merges crossing print boundaries, repeating print titles, headers/footers and print headings are reported as unsupported. strict=True refuses these before writing the output; without strict the engine warns and writes the supported content.

CLI: oxidocs xlsx-to-pdf [--strict] [--quiet] input.xlsx output.pdf.

Excel の PDF 出力

oxidocs.xlsx_to_pdf("帳票.xlsx", "帳票.pdf") で、表示中のシートを順に PDFへ出力できます。印刷範囲、用紙サイズ・向き、余白、倍率、ページへの 縮小、手動改ページ、結合セル、数値書式、背景色、単純な罫線に対応します。 数式には保存済みの計算結果を使い、再計算やマクロ実行は行いません。 Excelとの完全な印刷一致を保証する段階ではありません。グラフ・図形、 条件付き書式、印刷タイトル、ヘッダー/フッターなどは未対応として報告し、 strict=True を指定すると出力前に UnsupportedContent で停止します。

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
oxidocs pptx-to-pdf deck.pptx deck.pdf

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

How faithful is it?

The figures below are for Word documents. Slides have no such measurement for this PDF output yet.

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.post2

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.post2
File Actions
oxidocs-0.9.0.post2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for oxidocs-0.9.0.post2-py3-none-win_amd64.whl
oxidocs-0.9.0.post2-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for oxidocs-0.9.0.post2-py3-none-manylinux_2_28_x86_64.whl
oxidocs-0.9.0.post2-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for oxidocs-0.9.0.post2-py3-none-manylinux_2_28_aarch64.whl
oxidocs-0.9.0.post2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for oxidocs-0.9.0.post2-py3-none-macosx_11_0_arm64.whl
oxidocs-0.9.0.post2-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for oxidocs-0.9.0.post2-py3-none-macosx_10_12_x86_64.whl

Total release size: 266.7 MB

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

Download URL oxidocs-0.9.0.post2-py3-none-win_amd64.whl
Size 53.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
3809209f91ed2e04cd224bce9688c168312579955eccfe430b735ece2fa10f73
BLAKE2b-256 checksum
How to use checksums
7b983df4ac80dce4f2859cf0b01ae1e078693e301e09a4d94860018fbadb22a3
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 16, 2026.

Transparency log

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

Download URL oxidocs-0.9.0.post2-py3-none-manylinux_2_28_x86_64.whl
Size 53.5 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5ba9bb4c6de4464cdb6798edeeac005288cec6e4ec9802b76ac571f86a637292
BLAKE2b-256 checksum
How to use checksums
e5d93e83fd7fa02e878654d2363b9c94809b271273aee8027abf7a8e49687dd1
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 16, 2026.

Transparency log

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

Download URL oxidocs-0.9.0.post2-py3-none-manylinux_2_28_aarch64.whl
Size 53.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
03a704ad41db6e83ef9990c7ba1a6143b0a3a167f01be42e3385602c874c6068
BLAKE2b-256 checksum
How to use checksums
ae0a6cd17f94bbb79474bc82ef55d94fe52538232c9f5bee6164682ba650a929
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 16, 2026.

Transparency log

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

Download URL oxidocs-0.9.0.post2-py3-none-macosx_11_0_arm64.whl
Size 53.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
499f1a74081269d090f23bf9456cca138e83ab294b0954ad29e27f3de436e049
BLAKE2b-256 checksum
How to use checksums
8c2606c97515c2c3aba3290d80f75dec16c6322bfcb3d24337429b92c322b8fa
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 16, 2026.

Transparency log

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

Download URL oxidocs-0.9.0.post2-py3-none-macosx_10_12_x86_64.whl
Size 53.2 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
41becc0de9a6b24af5cb3b2cb743c88edd5922f4304b4c7771158a9322eabaaa
BLAKE2b-256 checksum
How to use checksums
13e18ae0f50d89302743dcaaa29dfb7d0dff15a8b7fcac783ce2478bcf7cef49
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 16, 2026.

Transparency log

Security for oxidocs 0.9.0.post2

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.post2-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 16, 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