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 で停止します。

Pages without drawing: which page is each paragraph on?

A .docx stores no pages: Word works them out when it lays the document out. Tools that read .docx therefore cannot say on which page a heading or a paragraph sits, and a search or RAG pipeline cites every passage of a long Word file as "page 1". The page break markers Word leaves in a file are only as fresh as its last save in Word, and files written by programs have none.

docx_to_docling lays the document out as Word would and returns its structure and text as a DoclingDocument, nothing drawn. Every heading, paragraph, list item, table and picture carries the page it is on and its box there:

import oxidocs

doc = oxidocs.docx_to_docling("contract.docx")
for item in doc["texts"]:
    for p in item["prov"]:
        print(p["page_no"], p["bbox"], item["text"][:40])

With docling-core installed, the same dict loads as a DoclingDocument, so docling's own exports work page by page:

from docling_core.types.doc import DoclingDocument

doc = DoclingDocument.model_validate(oxidocs.docx_to_docling("contract.docx"))
page_3 = doc.export_to_markdown(page_no=3)

Boxes are in points from the page's top left (coord_origin: "TOPLEFT"). An item that runs onto the next page has one entry per page. How headings, lists, tables, text boxes and equations are mapped is described in oxidocs-docling. Pages come from the same layout as the PDF output, so they are as close to Word's as the figures under How faithful is it? show.

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
oxidocs docx-to-docling report.docx report.json        # stdout without the second path

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. The equation converter used by docx_to_docling is a port of docling's and dwml's OMML converters (MIT and Apache-2.0); their notices ship in the package as oxidocs/THIRD_PARTY_NOTICES.md.

Metadata

Release files for oxidocs 0.9.0.post3

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

Total release size: 269.4 MB

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

Download URL oxidocs-0.9.0.post3-py3-none-win_amd64.whl
Size 54.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
2e553f15ddf4a5b2444fdd5cd64b2fe53cc19c3b82382dce804078ffe9c53cb0
BLAKE2b-256 checksum
How to use checksums
b9714808413d8b7c33c6c87a013399d3c0307cd6b4f17644a12f589cf8d4b86f
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 20, 2026.

Transparency log

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

Download URL oxidocs-0.9.0.post3-py3-none-manylinux_2_28_x86_64.whl
Size 54.1 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
292b599c68b20abcc08bdc7c367add44bc63191e12513a314590aafb8bd50dd7
BLAKE2b-256 checksum
How to use checksums
a14bee63b6747ea5f6e8623ab6e33a39c2cab13efbce12fd22960b28994b2b40
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 20, 2026.

Transparency log

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

Download URL oxidocs-0.9.0.post3-py3-none-manylinux_2_28_aarch64.whl
Size 53.5 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
7c717bcb74e965511d261b7caa8c4c442b88305f9fbe617dee7a48ecc2e606bf
BLAKE2b-256 checksum
How to use checksums
54a8e6c7bae1b473adc246f0f107239ee2bcdca9f0fb364d497d46a5d805cc9e
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 20, 2026.

Transparency log

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

Download URL oxidocs-0.9.0.post3-py3-none-macosx_11_0_arm64.whl
Size 53.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
815fa5e7308317e66932ca715faec73b8b4dc37ce517d2cd2be64bb48fd75d8c
BLAKE2b-256 checksum
How to use checksums
cfe222aaadc5a6deeb361777eacd100c374454fe5dc9d217e6fd50c2ffee1e8d
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 20, 2026.

Transparency log

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

Download URL oxidocs-0.9.0.post3-py3-none-macosx_10_12_x86_64.whl
Size 53.8 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4cd4bf6c4aa3d7a5f34f38aabef82c0af2c8d34507acfc027ad46f2c4553bf78
BLAKE2b-256 checksum
How to use checksums
685c606c1a037d6282ce886e64427a243459218d80e7148beb373554555af575
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 20, 2026.

Transparency log

Security for oxidocs 0.9.0.post3

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.post3-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 20, 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