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, and adds poppler for reading PDFs. These are best installed via your package manager:
apt install python3-cairo python3-cairocffi gir1.2-poppler
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.1b1.tar.gz
.
File metadata
- Download URL: htmloverpdf-0.0.1b1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30f12e94bfd328ab4653f93cdb56f53f743f5b735ffff8ea4cdb8c8504388746 |
|
MD5 | 5758de578cb49f8a2f9a1ee847cf8f99 |
|
BLAKE2b-256 | 86dd66466586ae3b1b2cf6ae87549b1422c77cd623c8f5782079f9add43a1e7e |
Provenance
File details
Details for the file htmloverpdf-0.0.1b1-py3-none-any.whl
.
File metadata
- Download URL: htmloverpdf-0.0.1b1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77169e9a255ee787cbe2212abf24383e1091d33c6926496aaef8154294fdc400 |
|
MD5 | cbbed8a4fea8e7ffcf617c9b47e69395 |
|
BLAKE2b-256 | 14493524630c760a4ecbf5449a064e8daec291257864e609e59b8d5c72e3ec13 |