pawel-slowik / htmlpdf

Create PDF documents from YAML data and Jinja2 HTML templates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Coverage

A tool for creating PDF documents from YAML data and Jinja2 HTML templates. Uses the excellent WeasyPrint library for rendering HTML to PDF.

Installation

The script is not packaged, run it from a repository clone. Install dependencies with:

pip3 install -r requirements.txt

Or use Docker:

docker-compose build

Usage

Run:

./htmlpdf.py -i input.yaml -t template.html -o output.pdf

With Docker:

docker-compose run --rm cmd ./htmlpdf.py -i input.yaml -t template.html -o output.pdf

Examples

cd examples
../htmlpdf.py -i CV_PL.yaml -t CV_PL.html -o CV_PL.pdf
../htmlpdf.py -i CV_PL.yaml -i CV_star_ratings.yaml -t CV_star_ratings.html -o CV_star_ratings.pdf

With Docker:

docker-compose run --rm example1
docker-compose run --rm example2

About

Create PDF documents from YAML data and Jinja2 HTML templates.

License:MIT License


Languages

Language:Python 97.9%Language:Dockerfile 1.6%Language:HTML 0.5%