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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4918741e19317691d03140c36077938cdc9f0ca8bc1c7300aa0ec65c4f0127ac
|
|
| MD5 |
0003b3c17b05d92d21ec4b77ace267bf
|
|
| BLAKE2b-256 |
89e587fd1ce07b66a7aeca6900475aa961d001d00b2d4b257ba19a0a65c37659
|
Provenance
The following attestation bundles were made for docx2img-0.1.1.tar.gz:
Publisher:
publish-to-pypi.yml on HuiTurn/docx2img
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docx2img-0.1.1.tar.gz -
Subject digest:
4918741e19317691d03140c36077938cdc9f0ca8bc1c7300aa0ec65c4f0127ac - Sigstore transparency entry: 2287541670
- Sigstore integration time:
-
Permalink:
HuiTurn/docx2img@1ef511f2628fd9ef0fff0414420e7bdcccd62c46 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/HuiTurn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1ef511f2628fd9ef0fff0414420e7bdcccd62c46 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8afe5043b441cf45806f96e2721ba211ee234c3fd7faca5ed92b9f288f25622
|
|
| MD5 |
e382e09f2116885c919183ac9b6a6094
|
|
| BLAKE2b-256 |
99503a223ab45d8e7c7275ff45cb574bbabc1808e3e299c65d56f4b4af2ce4f9
|
Provenance
The following attestation bundles were made for docx2img-0.1.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on HuiTurn/docx2img
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docx2img-0.1.1-py3-none-any.whl -
Subject digest:
e8afe5043b441cf45806f96e2721ba211ee234c3fd7faca5ed92b9f288f25622 - Sigstore transparency entry: 2287541683
- Sigstore integration time:
-
Permalink:
HuiTurn/docx2img@1ef511f2628fd9ef0fff0414420e7bdcccd62c46 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/HuiTurn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1ef511f2628fd9ef0fff0414420e7bdcccd62c46 -
Trigger Event:
push
-
Statement type: