Skip to main content

docx2img

A pure Python .docx → image rendering engine. No Microsoft Office or LibreOffice required.

Features

  • Paragraphs, runs, fonts, colors, bold/italic/underline/strikethrough
  • Full style inheritance and theme resolution
  • Tables with merged cells, nested tables, and borders
  • Inline images and floating images with text wrap
  • Multi-section documents, landscape pages, multi-column layout
  • Headers, footers, and page numbers
  • Ordered / unordered lists with numbering
  • Word-style pagination with widow/orphan control and cross-page tables
  • CJK line breaking, punctuation hanging, justification, and document-grid layout
  • Justified text, tab stops, text boxes
  • OMML math (fractions, super/subscripts, radicals, accents, bars, limits, equation arrays)
  • Footnotes and endnotes with continuation pages
  • DrawingML and legacy VML shapes, text boxes, flowchart nodes, and arrows

Installation

pip install docx2img

Usage

CLI

docx2img input.docx output.png --dpi 150

Python API

from docx2img import Config, convert, convert_to_images

# A multi-page document is saved as output_1.png, output_2.png, ...
convert("input.docx", "output.png", dpi=150)

# Per-page images
pages = convert_to_images("input.docx", Config(dpi=150))
for i, img in enumerate(pages):
    img.save(f"page_{i + 1}.png")

Development

pip install -e ".[dev]"
python -m pytest tests/ -v

See docs/technical_design.md for architecture details.

License

MIT

Metadata

Release files for docx2img 0.1.2

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

Source distribution (sdist)

Source distribution for docx2img 0.1.2
File Size Uploaded Provenance Actions
docx2img-0.1.2.tar.gz 114.6 kB With provenance Details for docx2img-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for docx2img 0.1.2
File Interpreter ABI Platform Actions
docx2img-0.1.2-py3-none-any.whl Python 3 none any Details for docx2img-0.1.2-py3-none-any.whl

Total release size: 245.6 kB

Release files / docx2img-0.1.2.tar.gz

Download URL docx2img-0.1.2.tar.gz
Size 114.6 kB
Tags Source
SHA-256 checksum
How to use checksums
14ab1f2468c2ba856970d2eda62411a78a575d710aa11c44427191abdef28ec5
BLAKE2b-256 checksum
How to use checksums
2c9c75c08c4a6295dad04ec7dbaa947af7a530a27c6e28a00b44eb13599c6af5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Jul 31, 2026.

Transparency log

Release files / docx2img-0.1.2-py3-none-any.whl

Download URL docx2img-0.1.2-py3-none-any.whl
Size 131.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84e3c65dab0aeec4261e0d6d7a140b5c9ca88ac2cfcb93424c36471b03b7cdfa
BLAKE2b-256 checksum
How to use checksums
6119011135bce3d87e031b6c6f45c9186de334b12035d8c659c9df26d06071a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Jul 31, 2026.

Transparency log

Security for docx2img 0.1.2

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for docx2img-0.1.2.tar.gz

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 Jul 31, 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