Tombola card pdf generator from html format template
pip3 install jinja2
pip3 install pdfkit
pip3 install PyPDF2
sudo apt install wkhtmltopdf
or
pip3 install -r requirements.txt
cat cards_set.txt > python3 pdf_formatter.py
OR
Pipe generator output directly into pdf_formatter
python3 generator.py | python3 pdf_formatter.py -b "place your bottom text here"
-n Number of card sets. Default value is 1
-b Bottom text
-l Logo filename
-t Template (HTML) filename
-o Output PDF filename
This command will generate 5 card sets:
python3 generator.py -n 5 | python3 pdf_formatter.py -b "place your bottom text here" -l logo.jpeg
All the sets will be merged into a single pdf file
python3 pdf_formatter.py -b "First line <br> second line <br> third line"
Divide multiple lines with "<br>" HTML tag
Input must be formatted in the following way: cards_set.txt sample
Formatting rules:
- there must be two lines for each card:
- the first one is the name of that card inside the set
- the second one is a Python list containing one list of integers for each row (of that card)
- everything after the last pair of lines will be discarded (odd line)
- blank fileds placeholder is -1