Metadata-Version: 2.4
Name: docquill-rust
Version: 0.1.5
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: Implementation :: CPython
Summary: High-performance Rust components for DocQuill: PDF renderer and EMF/WMF converter
Keywords: docquill,pdf,emf,wmf,rust,renderer,converter,performance
Author: AddNap
License-Expression: Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/AddNap/DocQuill
Project-URL: Repository, https://github.com/AddNap/DocQuill

# DocQuill Rust Components

[![PyPI version](https://badge.fury.io/py/docquill-rust.svg)](https://badge.fury.io/py/docquill-rust)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

**High-performance Rust components for DocQuill:**

- 🖨️ **PDF Renderer** - Fast PDF generation using pdf-writer
- 🖼️ **EMF/WMF Converter** - Convert Windows metafiles to SVG

## Installation

```bash
pip install docquill-rust
```

Or install with the main package:

```bash
pip install docquill[rust]
```

## Requirements

- Python 3.9+
- **No Rust compiler required** - pre-built wheels are available for:
  - Linux (x86_64, aarch64)
  - macOS (Intel x86_64, Apple Silicon arm64)
  - Windows (x86_64)

## Features

### PDF Renderer

High-performance PDF generation as an alternative to ReportLab:

```python
from docquill import Document

doc = Document.open("document.docx")

# Use Rust backend (automatically detected when installed)
doc.to_pdf("output.pdf", use_rust=True)
```

**Benefits:**
- 2-5x faster PDF generation
- Lower memory usage
- Full Unicode support (DejaVu Sans embedded)

### EMF/WMF Converter

Convert Windows Enhanced Metafile (EMF) and Windows Metafile (WMF) to SVG:

```python
import docquill_rust

# Convert file
docquill_rust.convert_emf_to_svg("input.emf", "output.svg")

# Convert bytes to SVG string
svg_content = docquill_rust.convert_emf_bytes_to_svg(emf_bytes)
```

**Supported formats:**
- EMF (Enhanced Metafile)
- EMF+ (GDI+ Enhanced Metafile)
- WMF (Windows Metafile)
- WMF with embedded EMF

**Performance:** ~50x faster than Java-based converters (FreeHEP/Apache POI)

## Building from Source

If you need to build from source (e.g., for unsupported platforms):

```bash
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install maturin
pip install maturin

# Build and install
cd packages/docquill_rust
maturin develop --release
```

## License

Apache License 2.0


