Skip to main content

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 orientation
  • margin(points) — uniform margin in points (72 points = 1 inch)
  • convert(html) → PDF bytes
  • convert_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


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.4.3.tar.gz (4.9 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.4.3-cp312-cp312-win_amd64.whl (7.7 MB view details)

Uploaded CPython 3.12Windows x86-64

ironpress-1.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ironpress-1.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

ironpress-1.4.3-cp312-cp312-macosx_11_0_arm64.whl (7.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ironpress-1.4.3-cp312-cp312-macosx_10_12_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for ironpress-1.4.3.tar.gz
Algorithm Hash digest
SHA256 6633620b54128b1ad7d7fa88793b36a54af1f29a681e9b9f4277e41ebd9b226b
MD5 df80230415ce0d0dd3971e8c4537a407
BLAKE2b-256 d5b156e8d14ba36cae84554b6319666feffa93737835ed28370fe9c9d6b5382f

See more details on using hashes here.

File details

Details for the file ironpress-1.4.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for ironpress-1.4.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7c52401809d72ac94066ccecd7ab2822b287bc4c3ffd7a0e1eeefdb44735a2b6
MD5 7e7e9b355b4d2a2128c89362fb01d4af
BLAKE2b-256 caebeb24162baa88cccc71568f8863e449fabfae7bbc9b255e1e5810a50aacbb

See more details on using hashes here.

File details

Details for the file ironpress-1.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ironpress-1.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e6df67e681c8c82182f07adb0f3c0dfad790ce780cc6f5a639cce4cee984c539
MD5 080774c6369d87710fab001e19e82bc4
BLAKE2b-256 695831919e6858585db771ba3953f7c55c227011f5e7dd61271ede35b3e5f364

See more details on using hashes here.

File details

Details for the file ironpress-1.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ironpress-1.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a91c7dad3161bda73356ee2b3c4ae1af4c57da3942163a98d44478ee969a0ab3
MD5 1e2d5e219df2a2995f8187238569e89b
BLAKE2b-256 61564e89362ff6a9b9b6b881fe76ff25b94572a5169dee2f15390c47d03f39fd

See more details on using hashes here.

File details

Details for the file ironpress-1.4.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ironpress-1.4.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6fc69a07dd5772c64b12055f11d731859839dc31a90c32cc705766782f34c6b1
MD5 42368bf675cc35fe00b902b563aa804f
BLAKE2b-256 5dd5ce47f7e41722550133e67b33998981a5feebf60ccca27045edd860235ed3

See more details on using hashes here.

File details

Details for the file ironpress-1.4.3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ironpress-1.4.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 112979950dc0804671e569dd4c5a8acc65ad0dcb979218db459a59804d19bdee
MD5 272a81e286511a2acdb688d8c6f150c5
BLAKE2b-256 2689fab62f8069f506c972f0db9fcddbf1a1f645169576f5da48977cb21fe637

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page