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.0.tar.gz (96.7 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.0-py3-none-any.whl (113.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for docx2img-0.1.0.tar.gz
Algorithm Hash digest
SHA256 834ab99f0654522b2c938c8c72eeaebe1d0ea7fba368886a0f5b832d24858e8e
MD5 579f606223197d462d7e07cf11048b22
BLAKE2b-256 14a68d42a69caf7038db362d9210212071e8d68feb3e3a4fb41271f961a25196

See more details on using hashes here.

Provenance

The following attestation bundles were made for docx2img-0.1.0.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.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for docx2img-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 874853df7740fdbd5bc7ce8b36fcb77a054be0c8d4c86e2202b7ec0db02c7f4d
MD5 20f8316251aab8622b41dec2125d5e42
BLAKE2b-256 4c262542739769e01fccf9c56916493ce466ff87665e94e8c395aafc1f910073

See more details on using hashes here.

Provenance

The following attestation bundles were made for docx2img-0.1.0-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

0.1.1

2 files

This release

0.1.0 This release

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