Render a HTML overlay over existing PDF files
Project description
A wrapper for http://weasyprint.org/ which allows compositing with existing PDF files.
API: render(html) Input is a HTML string and output is the PDF bytes.
For weasyprint this needs cairo and cairocffi etc., this adds poppler for reading PDFs. These are best installed via your package manager:
apt install python3-gi-cairo gir1.2-poppler-0.18 python3-cairocffi python3-lxml gir1.2-pango-1.0
It parses the HTML looking for <img> tags with src urls ending “.pdf”. Each one begins a new page and copies all source pages overlaying the weasyprint output. The magic value “blank.pdf” outputs sections HTML without overlaying.
python -m htmloverpdf < test.html > test.pdf
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
Built Distribution
File details
Details for the file htmloverpdf-0.0.1b2.tar.gz
.
File metadata
- Download URL: htmloverpdf-0.0.1b2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ab830f1b9adb40fd9a83ab2fb44ca26b1fb3b3e4b4a91657ed1df88d02e34d5 |
|
MD5 | ffe6991b185b84fc5122481b0bf969eb |
|
BLAKE2b-256 | ac2f54d28ea7bd659077d0a4d21492e4dd9bf434474e0af28ab56c6c8a0be64a |
Provenance
File details
Details for the file htmloverpdf-0.0.1b2-py3-none-any.whl
.
File metadata
- Download URL: htmloverpdf-0.0.1b2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e31290a4bfc85cef477f9251d46da88995aafa2093684822898c7a0251c49e09 |
|
MD5 | 2e17743350983ae9506394b075e3e624 |
|
BLAKE2b-256 | aba36490f088bd2b42069f9f87fcad08be16be653cfce38f76bc23e727c87f23 |