Pure Rust HTML/CSS → PDF engine — Python binding
Project description
TypePress — Python
Pure Rust HTML/CSS → PDF engine. No browser required.
from typepress import TypePress
tp = TypePress()
# HTML → PDF
tp.html_to_pdf("report.html", "report.pdf")
# With options
tp.html_to_pdf(
"report.html",
"report.pdf",
size="A3",
landscape=True,
margin="10mm",
)
# Markdown → PDF
tp.md_to_pdf("report.md", "report.pdf")
# HTML → PNG (via pymupdf fallback)
tp.html_to_png("report.html", "report.png")
# Full API
tp.convert(
input="report.html",
output="report.pdf",
format="pdf", # pdf | svg | png
size="A4",
landscape=False,
margin="20mm",
scale=2.0, # PNG scale factor
)
Install
pip install typepress
The package auto-downloads the typepress binary for your platform on first use.
Requirements
- Python 3.8+
- Linux x86_64, macOS arm64/x86_64, or Windows x86_64
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
typepress-0.3.0.tar.gz
(3.2 kB
view details)
Built Distribution
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 typepress-0.3.0.tar.gz.
File metadata
- Download URL: typepress-0.3.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb86fb3f5f44b6b866a7fba20e3a23581b60029804146f544f5d220cc1c04992
|
|
| MD5 |
49242ad9371f38587e601eca47bb6298
|
|
| BLAKE2b-256 |
a1bae263fcb3abf54da47d5dd3d8e87fe77664ade000ff508d3eb66d745d8dcd
|
File details
Details for the file typepress-0.3.0-py3-none-any.whl.
File metadata
- Download URL: typepress-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
672438d9c451b5d123bc478c704b6d82873c173116074ef49db3f7727d1a21ab
|
|
| MD5 |
33758b253ab6ad57c384a5a17c3be89f
|
|
| BLAKE2b-256 |
6943b03a7857857cfc15987dbe5c4a9f208f54d944a9364c1f1b8b7629ccd995
|