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.2.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.2-cp312-cp312-win_amd64.whl (7.7 MB view details)

Uploaded CPython 3.12Windows x86-64

ironpress-1.4.2-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.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (7.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ironpress-1.4.2-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.2.tar.gz.

File metadata

  • Download URL: ironpress-1.4.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a9ec30d37fab5db99fdc03c053310452b2f3fabce0746b347802048cde694989
MD5 49a0ad4fe477a6d87aeb93c5cb05da18
BLAKE2b-256 16560ab5d311b7168fac91160c2b67412f4b68a5fcc3f72392da4643a7a552dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ab80d7c4d5324d10b3429c8a19e5f9e4455d9b4e0528549dc73f86c086e6b14d
MD5 15e22e46f1961ea553f7ce2cea7e2b87
BLAKE2b-256 4791f6334a87a1bbdda5569d292102b56b9573e1f466d33bfdcb98a620c3589b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 335be90a7595caa8d8792cd41c8cf6b8f3ceb7852b71644e8c22a5459c9cecb7
MD5 aa51384cfe8609275f29ea38dcf9b9a2
BLAKE2b-256 0892121185ba81f5107a0efc4810388876ea8924f73147a05d704d4390eb80ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 08934338a87f839e4a52c787d47c6dd075250eb0a4bb6e18d719d7a681d5d13e
MD5 9f94c8b4527e7b2272a9930de0b7a7d2
BLAKE2b-256 6f3fe4f11188c79e2179fcd962ee97f7af11c907ae12a9ea1a0239a97ee56fc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.4.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc9986b40d8985ee9031a59ecc2ec2363b065ce750396be4dada05347acc2720
MD5 91642db179121097e195c8009688f0b6
BLAKE2b-256 9917095583de3ba70d86ef0b3becdec9f2bd7a40c8a365dea50d32c759df5864

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ironpress-1.4.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5b19034c4feb9bbb8077af53f654db09319b43797481450c30cb861a7c76c3fc
MD5 370e957b9f31ab1781caabe346281d7c
BLAKE2b-256 ab6b79537c8f8e93448f9db55cdb185e7580f26edc80d5013978075abee341f9

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