Metadata-Version: 2.4
Name: docx2img
Version: 0.1.1
Summary: Pure Python DOCX to Image rendering engine
Author-email: HuiTurn <xiaohuimc@hotmail.com>
License: MIT
Project-URL: Homepage, https://github.com/HuiTurn/docx2img
Project-URL: Repository, https://github.com/HuiTurn/docx2img
Project-URL: Issues, https://github.com/HuiTurn/docx2img/issues
Keywords: docx,image,render,converter,pillow
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Text Processing :: Markup
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: Pillow>=10.0
Requires-Dist: fonttools>=4.40
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Provides-Extra: office
Requires-Dist: pywin32>=306; platform_system == "Windows" and extra == "office"

# 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

```bash
pip install docx2img
```

## Usage

### CLI

```bash
docx2img input.docx output.png --dpi 150
```

### Python API

```python
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

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

See [`docs/technical_design.md`](docs/technical_design.md) for architecture details.

## License

MIT
