Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ironpress-1.6.0.tar.gz (5.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ironpress-1.6.0-cp38-abi3-win_amd64.whl (8.9 MB view details)

Uploaded CPython 3.8+Windows x86-64

ironpress-1.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

ironpress-1.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.6 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

ironpress-1.6.0-cp38-abi3-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

ironpress-1.6.0-cp38-abi3-macosx_10_12_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file ironpress-1.6.0.tar.gz.

File metadata

  • Download URL: ironpress-1.6.0.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.15.0

File hashes

Hashes for ironpress-1.6.0.tar.gz
Algorithm Hash digest
SHA256 5235c9e254c3b56dac22b9e91c307bd824f14f1e9b6ee2767b39a778af280651
MD5 ef4b1cb1ee1d3248a613dababf2ff19d
BLAKE2b-256 81ef3d5f0f9a4cdf62702c52176834fc15b85ab531faef402896c76ec7d40eab

See more details on using hashes here.

File details

Details for the file ironpress-1.6.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: ironpress-1.6.0-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.15.0

File hashes

Hashes for ironpress-1.6.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5b2f4edd0c1e11998724b5c8a319e1473c3a92b5f7badc2f496ce283847f5a4b
MD5 03bb5915ca1262743f4058d0630bbf61
BLAKE2b-256 3815b684a3f981034fb9b6b172cf1da1beacc7cba2a80b3d98e6f9086c51e10e

See more details on using hashes here.

File details

Details for the file ironpress-1.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ironpress-1.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae6cba5d49c47bf822792dd2e70bb939956996bc592c45e59e0fd7f289653ac8
MD5 7fea7220a486afada06729a08e98180f
BLAKE2b-256 bd24397e26299d5d2ae6091cbb5419a9e8b8bf375000bb2670ae138cdd9d34fe

See more details on using hashes here.

File details

Details for the file ironpress-1.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ironpress-1.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d2ad6abc74e127ae1e29721f7a45f09a077b66fce874d0169c419a8ee8b9d392
MD5 2f4d713d20511a5ea5c74ffd64786a4a
BLAKE2b-256 1861c0395ce79ca86647c9f2b9af4273326677ffb0f03ffcd28ad0b739480ab1

See more details on using hashes here.

File details

Details for the file ironpress-1.6.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ironpress-1.6.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 84165f505c15933e1a4f1aff232cf9d032b126f454420c605125ffd0e43ae2b0
MD5 40bce8bdf8eb45f526fc691bde58525a
BLAKE2b-256 f7c36f2593e00246d48e802b760f521786ebd53d628fc4b5ee9cb3de31741d67

See more details on using hashes here.

File details

Details for the file ironpress-1.6.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ironpress-1.6.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 60b55d5656e1444fd60090fcc67cfc9e89bc04735fb26e0f06a3900936322258
MD5 6eb2b2f005dcb1840281084436b743a7
BLAKE2b-256 3a52e92ce04d829c8810f82ea34ee5566dff5d3c672f8134ef6cb084b16dff3d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.6.0 This release

6 files

1.5.4

6 files

1.5.3

6 files

1.5.2

6 files

1.5.1

6 files

1.5.0

6 files

1.4.4

6 files

1.4.3

6 files

1.4.2

6 files

1.4.1

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page