Skip to main content

docx-rs

Fast DOCX-to-PDF conversion with a Rust layout engine whose output matches LibreOffice's, without running LibreOffice.

from docx_rs import convert, convert_bytes

convert("document.docx", "document.pdf")
pdf_bytes = convert_bytes(open("document.docx", "rb").read())

Conversions release the GIL, so threads convert in parallel.

Supported documents

The renderer only produces a PDF when it supports everything in the document. A document using unsupported features raises docx_rs.UnsupportedDocument, whose findings list each unsupported construct; it never returns an approximate PDF. Support currently covers typical generated legal documents: styles, numbering, tables, sections, headers and footers, fields such as cached tables of contents, text boxes and images. Use docx_rs.inspect(path) to see the eligibility report without converting.

Fonts

The package bundles open fonts and substitutes them for common Microsoft fonts: TeX Gyre Termes for Times New Roman, Carlito for Calibri, Caladea for Cambria, Liberation Sans and Mono for Arial and Courier New, OpenSymbol for Symbol and DejaVu Sans for Segoe UI Symbol. These are the substitutions a typical Linux LibreOffice installation makes. Each font keeps its own licence; see docx_rs/fonts/licenses/. A custom font profile can be passed as font_profile= (a profile JSON path or docx_rs.FontProfile.load(path)).

Metadata

Release files for docx-rs-4jy72q 0.1.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 docx-rs-4jy72q 0.1.0
File Interpreter ABI Platform
docx_rs_4jy72q-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
docx_rs_4jy72q-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
docx_rs_4jy72q-0.1.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details

Total release size: 20.8 MB

Release files / docx_rs_4jy72q-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL docx_rs_4jy72q-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bcff517b07559ed65fd87866d13904e96791a3e81bfe7504033172a15d85e3e2
BLAKE2b-256 checksum
How to use checksums
e7c714c984803b99e239764c64abf5335ede32b20e7ca35e84161c1b67780d53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / docx_rs_4jy72q-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL docx_rs_4jy72q-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.1 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
df1f3a9dbff1927e3c0a9fb295aec9217019d50ce9bf9ebaed3f4cc424a15e48
BLAKE2b-256 checksum
How to use checksums
713e2edb211b6b120ededeed083603137d2017f9bfa6c359891bfc8b2e056b9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / docx_rs_4jy72q-0.1.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL docx_rs_4jy72q-0.1.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 8.4 MB
Tags CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f6b23f02d2819235a82d23b2bd5e1f05683ca35fabe8567acef01cc53849cf13
BLAKE2b-256 checksum
How to use checksums
4333b844d0c81d371547a3e498cb7721f70ee7c5a27cbaee432b16e51236025a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

0.1.0 This release

3 release files

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