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.2.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.2.tar.gz.
File metadata
- Download URL: typepress-0.3.2.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 |
31e12ac5a3aaf8e5805c340487c6d7778bcce0e9115337703e86b9e77f4f875f
|
|
| MD5 |
4cb87b7d167c456ff2112e89c5683630
|
|
| BLAKE2b-256 |
0a807ffa6ac89dab2abe9ae1c3fd436a98c0246a0ef4651702dc73fc92ceb5de
|
File details
Details for the file typepress-0.3.2-py3-none-any.whl.
File metadata
- Download URL: typepress-0.3.2-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 |
0d6a54fab80ca5bc271168a84a38b5c92a28e28266f83fe24c0cf07a8014d132
|
|
| MD5 |
7e1f3c2a5b265dd57f902ef3b0ed3fca
|
|
| BLAKE2b-256 |
045b755b84bbb5299d58f742c73debf1cddcf8ce9427e14401c478750b11d7bf
|