Pure Rust HTML/CSS/Markdown to PDF converter. No browser, no system dependencies.
Project description
ironpress
Pure Rust HTML/CSS/Markdown to PDF converter. No browser, no system dependencies.
Installation
pip install ironpress
Quick Start
import ironpress
# Simple conversion
pdf = ironpress.html_to_pdf("<h1>Hello World</h1><p>Generated with ironpress.</p>")
with open("output.pdf", "wb") as f:
f.write(pdf)
# Markdown
pdf = ironpress.markdown_to_pdf("# Hello\n\nGenerated from **Markdown**.")
# Advanced options
converter = ironpress.HtmlConverter()
converter.page_size("Letter")
converter.landscape(True)
converter.margin(36.0) # 0.5 inch margins
pdf = converter.convert("<h1>Landscape PDF</h1>")
API
html_to_pdf(html: str) -> bytes
Convert an HTML string to PDF bytes.
markdown_to_pdf(markdown: str) -> bytes
Convert a Markdown string to PDF bytes.
HtmlConverter
Configurable converter with options:
page_size(name)—"A4","Letter", or"Legal"landscape(enabled)— landscape orientationmargin(points)— uniform margin in points (72 points = 1 inch)convert(html)→ PDF bytesconvert_markdown(markdown)→ PDF bytes
Performance
- 10-100x faster than browser-based solutions (Puppeteer, Playwright)
- ~5MB binary, no runtime dependencies
- Instant startup, no browser process
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 ironpress-1.4.1.tar.gz.
File metadata
- Download URL: ironpress-1.4.1.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80989b9a8c19c766136d4d91a7993049d1e7740683d7e9ab0707c4859fb76621
|
|
| MD5 |
ff2b0d92fb0b5b3777396f75176894e1
|
|
| BLAKE2b-256 |
8f785e1a1b9707e2fd3b1fd93ec2f3d5381d5b405a549f20ad048b7139f7ef72
|
File details
Details for the file ironpress-1.4.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: ironpress-1.4.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a491ca9e05013284c53ead51375c1c2d7d85db49171d4580799c91a80228d17
|
|
| MD5 |
e8dc6c7ee73afa7c6e8a18d91814a028
|
|
| BLAKE2b-256 |
d129bd09a1b4d4b837672310b02eddb31c72f4cf1a5a21fafcb9f1150e75772d
|
File details
Details for the file ironpress-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ironpress-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52b40831f6d8291ac7a9147cff1662bc8d4d3ff7bc2d0e478099df913ef6812b
|
|
| MD5 |
b0940e5abc9e5e49a3d8d895e37eb84d
|
|
| BLAKE2b-256 |
c07e949c70bf7e76c241595841dc9daa44f7bc43068a9d9fa800914e8dc053ba
|
File details
Details for the file ironpress-1.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ironpress-1.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12bcbb8ed543f404129befdd9de145bd1c25d28ec309af8826b5b98f51b994c5
|
|
| MD5 |
5c3711fb604530383cb1703e790312e0
|
|
| BLAKE2b-256 |
e3e5ede6876ee7bce0694a6c75f60a37ed0a141d3843aa2e6da0aaa929964dad
|
File details
Details for the file ironpress-1.4.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: ironpress-1.4.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a554fba296746324d08d898fe58de1e944e28c28fc5226d9af7275103282dd3
|
|
| MD5 |
9db93380b1d6868d10937e1a19c0ef80
|
|
| BLAKE2b-256 |
508d602dd808d751b7d3f2fbe8f6dfa57c6078a49829ea4eff32dcadc4cfe108
|
File details
Details for the file ironpress-1.4.1-cp312-cp312-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ironpress-1.4.1-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63edd541c41f083e2a3ab5c70a031fc90342fda6ed88d19bb1fb62fb4309b2ef
|
|
| MD5 |
500599e494300cb901faf2b051259d6a
|
|
| BLAKE2b-256 |
d9b4fd82f3e016919a1277a0825433d764df24a5d29d55bdb827bc16937d9889
|