HTML to PDF: A Plugin for Pelican
HTML to PDF is a Pelican plugin for generating PDFs from specific articles and pages HTML files. This plugins differs from the PDF Pelican plugin as :
- It generates a PDF only for the articles/pages flagged for.
- The generation is based on the HTML files and can be styled with CSS
Works on top of wkhtmltopdf and pdfkit.
Installation
This plugin can be installed via:
python -m pip install pelican-html-to-pdf
As long as you have not explicitly added a PLUGINS setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add html_to_pdf to your existing PLUGINS list. For more information, please see the How to Use Plugins documentation.
Dependancies
- wkhtmltopdf (system)
- pdfkit (Python)
Usage
Simply add the metadata To_pdf to your page to trigger a PDF generation for the page/article.
The value can be empty, or a python dictionnary to set the file name and/or add a stylesheet :
To_pdf: {'name': 'mysuperfile', 'css': 'content/static/print.css'}
Note :
- PDF files will be generated at the same path as the HTML file.
- Identical names at same path will result in overwriting.
Emojis
For emojis support in wkhtmltopdf, the font has to be set to one with emoji support which will depend of the system or has to be fetched online (ex: Noto Color Emoji on my system).
For emojis added through css content, use the unicode.
Contributing
Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.
To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.
License
This project is licensed under the AGPL-3.0 license.
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
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 pelican_html_to_pdf-2.0.0.tar.gz.
File metadata
- Download URL: pelican_html_to_pdf-2.0.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d612d45db1e4d26f4fbef755c9d3674fb3814d6540a9f5bd9c1198d12fdb6b87
|
|
| MD5 |
2e561127490355865a4dc93888eb1cc0
|
|
| BLAKE2b-256 |
2722696eae1cb708f99dd41aeee57223b99fde370406c96efac967c320238aec
|
File details
Details for the file pelican_html_to_pdf-2.0.0-py3-none-any.whl.
File metadata
- Download URL: pelican_html_to_pdf-2.0.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6259c1a55df1a4cca8116a56eb7e959d6d8f3e68f1b1abc87f7f5fa5a7740f68
|
|
| MD5 |
f3b5e85e5e6da4e06a000087822c9cd2
|
|
| BLAKE2b-256 |
654e15afbc1714b649dcfa3a27c7de82865c9657b032c6d846dac1797c93b143
|