Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mc-cat-tty/tombolacardpdf

Tombola card pdf generator from html format template
https://github.com/mc-cat-tty/tombolacardpdf

bingo bingo-cards bingo-game bingo-generator boardgame cards-set christmas epiphany game games html jinja2 jinja2-templates new-year pdf pdf-formatter python3 template tombola tombola-cards

Last synced: 11 days ago
JSON representation

Tombola card pdf generator from html format template

Awesome Lists containing this project

README

        

# TombolaCardPDF
Tombola card pdf generator from html format template

## Results
![Result](Result.png)
![Card](CardResult.png)

## Setting up
```
pip3 install jinja2
pip3 install pdfkit
pip3 install PyPDF2
sudo apt install wkhtmltopdf
```

or

```
pip3 install -r requirements.txt
```

## Run the script
```
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"
```

### _generator.py_ arguments
-n Number of card sets. Default value is 1

### _pdf_formatter.py_ Arguments
-b Bottom text

-l Logo filename

-t Template (HTML) filename

-o Output PDF filename

### Genrate multiple card sets
![Results](Results.png)

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

### Bottom text on multiple lines
```
python3 pdf_formatter.py -b "First line
second line
third line"
```
Divide multiple lines with "<br>" HTML tag

## _cards_set.txt_ sample
Input must be formatted in the following way: [cards_set.txt sample](cards_set.txt)

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