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}")

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.5.4.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.5.4-cp38-abi3-win_amd64.whl (8.9 MB view details)

Uploaded CPython 3.8+Windows x86-64

ironpress-1.5.4-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.5.4-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.5.4-cp38-abi3-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

ironpress-1.5.4-cp38-abi3-macosx_10_12_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for ironpress-1.5.4.tar.gz
Algorithm Hash digest
SHA256 b03e5bd2b6b2bf75efbbb2286f85da99268b4817ee81a990b5497b0dba09a27a
MD5 e4b3ace0d0c33094b1b9448eabf9bd95
BLAKE2b-256 3ab2794f9ab8acee71725cb7d91e75d8eff772c072e6fe4e6db8325f71f9b6d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ironpress-1.5.4-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

Hashes for ironpress-1.5.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7567a41b2eb5e0fdbaec318306bad36d3a8849b927798e0289a046435a9bbb6f
MD5 8cb92f287a77deeea57e3463c881b6db
BLAKE2b-256 8569a27b7933e2b335b5edfa5cad93f1a7d2e43584ed792760aec72e9ffa67a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.5.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ab449672ec976d80ef628bd837f80e32621b95ad00eddab6b09c1166c692f5f4
MD5 cf61e2f195d4b8456e1876a1b4b342dc
BLAKE2b-256 bbee0ed4ea1a41c8598db8a69fea2db71e78f44e3552e9340cb32d79d024656f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.5.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 260ebadeca030e9b67246bcec00e4c47f2440b813a7f312504a3fe97b041297f
MD5 24af4932e452983d7e30a6745335f389
BLAKE2b-256 89e85f0903dd11808b563f8dc49d391ab9f8f608b0a209d204bcea37f1e65d9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.5.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9eac73ae3a69affeef3efe368a89eaad8cc95d980a7f3ca706ae071837fb777a
MD5 5e084acacbf5b6a9b096861213c48533
BLAKE2b-256 d4784cd2eb8e3f50e3759fb661c60f4877179086c7fe404392ba451980f8e234

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.5.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e2a047dafac74bcd86cd0dee3b773a031d4d04fc4a9a412b4df5c7905a728184
MD5 8e4809dba12e0be165e0b76362131d41
BLAKE2b-256 78f40ce7541b753333d6e479107bd5da166cba54dcdcce24a392f209edd79e3a

See more details on using hashes here.

Release history Release notifications | RSS feed

1.6.0

6 files

This release

1.5.4 This release

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