Metadata-Version: 2.1
Name: ironhide-html-to-pdf
Version: 1.2.0
Summary: Idiomatic Python SDK for the Ironhide HTML-to-PDF native engine (C ABI v1)
Home-page: https://ironhidepdf.com
Author: Oxbloom Software LLC
License: Ironhide Personal & Commercial Dual License (see LICENSE-PERSONAL.md and LICENSE-COMMERCIAL.md)
Project-URL: Homepage, https://ironhidepdf.com
Project-URL: Documentation, https://ironhidepdf.com/docs
Project-URL: Releases, https://gitlab.com/oxbloom/ironhide-releases
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Ironhide HTML-to-PDF Python SDK

Zero-dependency, PEP-561 typed Python 3.10+ SDK over the Ironhide C ABI v1 (`ctypes`).

## Quick Start

```python
from pathlib import Path
from ironhide_html_to_pdf import Font, render_pdf

result = render_pdf(
    "<!doctype html><h1>Invoice #1042</h1>",
    paper="a4",
    print_backgrounds=True,
    fonts=[Font.from_file("DejaVu Sans", "./fonts/DejaVuSans.ttf")],
)
Path("invoice.pdf").write_bytes(result.pdf)
```

## Streaming with Context Manager

Low-level `Request`, `render_preloaded`, and `Session` remain available for streaming, custom
limits, and explicit resource callbacks:

```python
import io
from ironhide_html_to_pdf import ResourceSupply, Session

buf = io.BytesIO()
with Session(request) as session:
    report = session.drive_to_stream(
        buf,
        on_resource=lambda req: ResourceSupply(
            sequence=req.sequence,
            url=req.url,
            mime_type="font/ttf",
            data=fetch_bytes(req.url),
        ),
    )
```

## Run Tests

```bash
PYTHONPATH=sdk/python python3 -m unittest discover -s sdk/python/tests -v
```
