Skip to main content

HTML to PDF: A Plugin for Pelican

Build Status PyPI Version Downloads License

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

pelican_html_to_pdf-2.0.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pelican_html_to_pdf-2.0.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

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

Hashes for pelican_html_to_pdf-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d612d45db1e4d26f4fbef755c9d3674fb3814d6540a9f5bd9c1198d12fdb6b87
MD5 2e561127490355865a4dc93888eb1cc0
BLAKE2b-256 2722696eae1cb708f99dd41aeee57223b99fde370406c96efac967c320238aec

See more details on using hashes here.

File details

Details for the file pelican_html_to_pdf-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pelican_html_to_pdf-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6259c1a55df1a4cca8116a56eb7e959d6d8f3e68f1b1abc87f7f5fa5a7740f68
MD5 f3b5e85e5e6da4e06a000087822c9cd2
BLAKE2b-256 654e15afbc1714b649dcfa3a27c7de82865c9657b032c6d846dac1797c93b143

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page