Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/unicsmcr/contract_generator
- Owner: unicsmcr
- Archived: true
- Created: 2018-07-08T12:37:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-08T12:43:14.000Z (over 6 years ago)
- Last Synced: 2024-08-13T07:07:52.501Z (5 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 2
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - unicsmcr/contract_generator - A pdf contract generator script (Python)
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}.pdfScript 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 filePlaceholders 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
>```