Ironpress for Python
Generate PDF bytes from HTML or Markdown without launching a browser.
Installation
pip install ironpress
Ironpress publishes ABI3 wheels for CPython 3.8 and later on Linux, macOS, and Windows.
Usage
import ironpress
pdf = ironpress.html_to_pdf("<h1>Hello</h1>")
with open("output.pdf", "wb") as output:
output.write(pdf)
Use a converter when several options must compose or multiple documents share the same policy:
converter = ironpress.HtmlConverter()
converter.page_size("Letter")
converter.margin_sides(36, 54, 36, 54)
converter.header("Quarterly report")
converter.footer("Page {page} of {pages}")
converter.sanitize(True)
pdf = converter.convert("<h1>Results</h1>")
The converter supports page geometry, PDF and image quality, sanitization,
headers and footers, custom TTF fonts, and optional CJK or emoji packs. Native
Python also supports constrained local resources through base_path() and
resource_root(), plus direct file output.
See the binding capability matrix for the contract shared with Rust, Ruby, and WebAssembly.
Font packs
Ironpress never downloads fallback fonts while rendering. Download the artifact your application needs, verify it as part of deployment, then install its bytes:
from pathlib import Path
converter = ironpress.HtmlConverter()
converter.add_font_pack(
"cjk-jp",
Path("ironpress-font-cjk-jp.ttf").read_bytes(),
)
pdf = converter.convert("<p lang='ja'>日本語</p>")
Valid pack names are cjk-jp, cjk-kr, cjk-sc, cjk-tc, and emoji.
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.5.3.tar.gz.
File metadata
- Download URL: ironpress-1.5.3.tar.gz
- Upload date:
- Size: 4.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f73d63de75831721e58af22b53fc24279dfcd03a419af80b36ec2ef6ab063d08
|
|
| MD5 |
089da00cac58a46e1420ad477a80e3d8
|
|
| BLAKE2b-256 |
1d199bd56267e0b01b9ff52effb64f962ff6657bf918e2969a31dd36029d3c57
|
File details
Details for the file ironpress-1.5.3-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: ironpress-1.5.3-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d2fe2ff09eae04595971854311e2734b5c1735ea9a1579b9153807777d21a6
|
|
| MD5 |
780ddb7f9cb4055b81645a90519df97a
|
|
| BLAKE2b-256 |
9c4438520a53112b13e1d56b895cb809a99448acf1c42a49197c9ec417216a13
|
File details
Details for the file ironpress-1.5.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ironpress-1.5.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 9.7 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9f3854f25f3f226d5bf1a1fc768201d657fb4ced464528ffbbc78954a0ec6e7
|
|
| MD5 |
be335e7b955cbfc6685817d2ac3ac439
|
|
| BLAKE2b-256 |
4809d0ae61829a23ae057f01e1c6bfadf64ea56a8b5c69095a9f37f971f8f906
|
File details
Details for the file ironpress-1.5.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ironpress-1.5.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 9.5 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cda1ed8f287cf5e8cd3bb50961191a65df68ec2b1d3062d0423681975c21f12
|
|
| MD5 |
481cc6fe4c0044fd20e1a03962e92c47
|
|
| BLAKE2b-256 |
d627b0af1aad2aff998b328e73ec0a0ede37b76ec3b3c160cda136da1636dd6b
|
File details
Details for the file ironpress-1.5.3-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: ironpress-1.5.3-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58d3eac8446ab39cc4c97e2b915e177b991c1e7452bbab0985d6642e9d5890b5
|
|
| MD5 |
16fa84583f9f83fd611236efbb3c2f60
|
|
| BLAKE2b-256 |
93ca83b06723185f13190dbb22be8e5d0c8787810fac7f53933ca9f8492edce8
|
File details
Details for the file ironpress-1.5.3-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ironpress-1.5.3-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d630abccb50ae587f2e9fa2424a649ebb9c6aff00742601fad7c68b56e74219e
|
|
| MD5 |
43da5157e86189d74eb215411818b361
|
|
| BLAKE2b-256 |
8f739ce6ae586e66739fa55a218fb44d9abf5cf7ba52e59dc8ba41e3944331a4
|