ironpress for Python
Generate PDF bytes from HTML or Markdown with a native Rust renderer. No browser process or system PDF dependency is required.
Read the complete Python getting-started guide.
Requirements
- CPython 3.8 or later
- Linux, macOS, or Windows
Published ABI3 wheels do not require a Rust toolchain.
Install
python -m pip install ironpress
Create your first PDF
from pathlib import Path
import ironpress
pdf = ironpress.html_to_pdf("<h1>Hello from Python</h1>")
Path("output.pdf").write_bytes(pdf)
The result is a Python bytes value. Write it to a file, return it from a web
response, or store it in your application.
Render Markdown
pdf = ironpress.markdown_to_pdf("# Release notes\n\nEverything shipped.")
Configure and reuse a converter
converter = ironpress.HtmlConverter()
converter.page_size("Letter")
converter.margin_sides(36, 48, 36, 48)
converter.header("Quarterly report")
converter.footer("Page {page} of {pages}")
# Use header_html/footer_html for sanitized images, tables, and styled markup.
converter.header_html("<strong>Quarterly report</strong>")
pdf = converter.convert("<h1>Results</h1>")
markdown_pdf = converter.convert_markdown("# Results")
Python configuration methods mutate the converter. Use convert_to_file or
convert_markdown_to_file when direct output is more convenient than bytes.
Local resources and fonts
Local URLs are denied until a canonical boundary is configured:
from pathlib import Path
converter = ironpress.HtmlConverter()
converter.base_path("templates")
converter.resource_root(".")
converter.add_font("Inter", Path("assets/Inter.ttf").read_bytes())
Optional fallback packs enter through add_font_pack. Valid names are
cjk-jp, cjk-kr, cjk-sc, cjk-tc, and emoji. Rendering never downloads
a font pack.
Limits and errors
- Invalid configuration and conversion failures raise
ValueError. - HTML sanitization is enabled by default.
- The binding has no async or streaming conversion API.
- Remote HTTP document resources are not available.
- JavaScript and browser DOM execution are not supported.
See the binding capability matrix for the contract shared with Rust, Ruby, browser WebAssembly, and Node.js.
Metadata
Release files for ironpress 1.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ironpress-1.7.0.tar.gz | 5.0 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| ironpress-1.7.0-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| ironpress-1.7.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| ironpress-1.7.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| ironpress-1.7.0-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| ironpress-1.7.0-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 51.5 MB
Release files / ironpress-1.7.0.tar.gz
| Download URL | ironpress-1.7.0.tar.gz |
|---|---|
| Size | 5.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1620a80e061205e15d9667fbe5623b4d8276025b5bfa611e4628aae32d8f340f
|
|
BLAKE2b-256 checksum How to use checksums |
097a649d336f85dae19be5b075c4faf6d96b036818b7c7cd1548ec4986b29da8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / ironpress-1.7.0-cp38-abi3-win_amd64.whl
| Download URL | ironpress-1.7.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 9.0 MB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6bee9c88ca8870febd4065d6fe6a2434cab32d349baffa1f3026ff61fb1461e6
|
|
BLAKE2b-256 checksum How to use checksums |
ffda64a5bef0b913b4871da717c7cf7e137ec129f9ccbf4f554430a16f77e2ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / ironpress-1.7.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ironpress-1.7.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 9.7 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
907fc7d7e4b942535deca863246b6ebcba12e32c153e9b742bb714bc2549dbaf
|
|
BLAKE2b-256 checksum How to use checksums |
e1496eeda061df4bf05737b96cc045a0a1d34576edfb664f32c5b93548e5fe84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / ironpress-1.7.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ironpress-1.7.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 9.6 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
92a89766c3223888141ef20839ffa4a463f969ed183f075aebc3100266ce1030
|
|
BLAKE2b-256 checksum How to use checksums |
fbb374360c00041ce09fd8e857d4b3a6b284188c6ce688c1ad0d19ae8185a2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / ironpress-1.7.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | ironpress-1.7.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 9.0 MB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5a4038b1b4d921dcec438b4793801c2baffd955f64849aa7ebc5993b8c606820
|
|
BLAKE2b-256 checksum How to use checksums |
7c6bd43b5dd74ed763cf21166484f06563c5f6ffea6e191359d8a3d39fc818b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / ironpress-1.7.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | ironpress-1.7.0-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 9.2 MB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
a6b2f64a70ef25c954f174a71dc9d757f8aed8e69c59f47d2a788f373554fa23
|
|
BLAKE2b-256 checksum How to use checksums |
5724e8e6abaa300a73712aa147fdf698ada5af2045ddb107654338827c843520
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|