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
  • Justified text, tab stops, text boxes
  • OMML math (fractions, super/subscripts, radicals, accents, bars, limits, equation arrays)
  • Footnotes and endnotes with continuation pages
  • DrawingML shapes and text boxes

Installation

pip install docx2img

Usage

CLI

docx2img input.docx output.png --dpi 150

Python API

from docx2img import convert, convert_to_images

# Single image (first page or stitched)
convert("input.docx", "output.png", dpi=150)

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

Development

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

See docs/technical_design.md for architecture details.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docx2img-0.1.1.tar.gz (107.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docx2img-0.1.1-py3-none-any.whl (123.9 kB view details)

Uploaded Python 3

File details

Details for the file docx2img-0.1.1.tar.gz.

File metadata

  • Download URL: docx2img-0.1.1.tar.gz
  • Upload date:
  • Size: 107.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for docx2img-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4918741e19317691d03140c36077938cdc9f0ca8bc1c7300aa0ec65c4f0127ac
MD5 0003b3c17b05d92d21ec4b77ace267bf
BLAKE2b-256 89e587fd1ce07b66a7aeca6900475aa961d001d00b2d4b257ba19a0a65c37659

See more details on using hashes here.

Provenance

The following attestation bundles were made for docx2img-0.1.1.tar.gz:

Publisher: publish-to-pypi.yml on HuiTurn/docx2img

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docx2img-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: docx2img-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 123.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for docx2img-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8afe5043b441cf45806f96e2721ba211ee234c3fd7faca5ed92b9f288f25622
MD5 e382e09f2116885c919183ac9b6a6094
BLAKE2b-256 99503a223ab45d8e7c7275ff45cb574bbabc1808e3e299c65d56f4b4af2ce4f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for docx2img-0.1.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on HuiTurn/docx2img

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 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