Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/unicsmcr/contract_generator

A pdf contract generator script
https://github.com/unicsmcr/contract_generator

Last synced: about 2 months ago
JSON representation

A pdf contract generator script

Awesome Lists containing this project

README

        

# PDF Contract Generator

### Dependencies:
* **Python 3** - download [here](https://www.python.org/download/releases/3.0/)
* **pdfkit** - to install run ```pip install pdfkit```
* **wkhtmltopdf** - installation instructions [here](https://wkhtmltopdf.org/)

### Usage:
The script takes an html template and a csv data file and produce a pdf file for each of the rows in the data file. The name of the generated file is: {firstColumnValueInDataFile}.pdf

Script can be run with:
```python pdfContract.py {template} {csvDataFile} {outputFolder}```
> **NOTE:** the structure of the csv file is defined within the template

### Creating templates:
The templates for the script are defined in HTML and CSS
> **NOTE:** the CSS for the template must be defined within the HTML file

Placeholders can be defined with the following syntax: ```[colx]``` where x is the column number (starting from 0) in the csv data file.

> **EXAMPLE:**
> The template:
>```html
>
>

First name: [col0]


>

Last name: [col1]


>
>```
>and the data file:
>```html
>Kristijonas,Zalys
>```
>would result in a pdf file:
>**Kristijonas.pdf:**
>```html
>First name: Kristijonas
>Last name: Zalys
>```