TG-48 readme

This commit is contained in:
DonRenando 2017-01-23 17:22:55 +01:00
parent ed0f2b1808
commit 58f9a6eebe
5 changed files with 25 additions and 30 deletions

View File

@ -8,6 +8,25 @@ Required :
* python >= 3.4 with pip (Un VirtualEnv est conseillé !) * python >= 3.4 with pip (Un VirtualEnv est conseillé !)
## pdfjinja
exigences pour ubuntu :
```
python-dev
python-pip
libtiff5-dev
libjpeg8-dev
zlib1g-dev
libfreetype6-dev
liblcms2-dev
libwebp-dev
tcl8.6-dev
tk8.6-dev
python-tk
pdftk
libmagickwand-dev
```
## Python ## Python
Si vous utilisez un virtualenv : Si vous utilisez un virtualenv :

View File

@ -5,7 +5,8 @@ import os
from pdfjinja import PdfJinja from pdfjinja import PdfJinja
def remplirTemplate (dirname_template, pdf_template, dirname_output_file, pdf_output,dictionnaire):
def remplir_template(dirname_template, pdf_template, dirname_output_file, pdf_output, dictionnaire):
""" """
Fonction qui permet de remplir un pdf template Fonction qui permet de remplir un pdf template
:param dirname_template: chemin du fichier de template :param dirname_template: chemin du fichier de template

View File

@ -1,25 +0,0 @@
#pdfjinja 1.0.0
##Dependencies :
python-dev
python-pip
libtiff5-dev
libjpeg8-dev
zlib1g-dev
libfreetype6-dev
liblcms2-dev
libwebp-dev
tcl8.6-dev
tk8.6-dev
python-tk
pdftk
libmagickwand-dev
##Installation:
pip install pdfjinja
##Test :
pdfjinja -h

View File

@ -3,3 +3,4 @@ flask-script < 2.1
flask-sqlalchemy < 2.2 flask-sqlalchemy < 2.2
flask-restful < 0.4 flask-restful < 0.4
mysqlclient < 1.4 mysqlclient < 1.4
pdfjinja < 1.1

View File

@ -1,12 +1,11 @@
import json
import os import os
import unittest import unittest
from io import BytesIO from io import BytesIO
from pathlib import Path from pathlib import Path
from pdfjinja import PdfJinja from pdfjinja import PdfJinja
from app.tools.pdfjinja.insertTemplate import remplirTemplate from app.tools.insertTemplate import remplir_template
class insertTemplateTestCase(unittest.TestCase): class insertTemplateTestCase(unittest.TestCase):
@ -39,7 +38,7 @@ class insertTemplateTestCase(unittest.TestCase):
del self.pdfjinja del self.pdfjinja
def test_render(self): def test_render(self):
remplirTemplate(self.datadir,"sample.pdf",self.datadir,"output.pdf",self.data) remplir_template(self.datadir, "sample.pdf", self.datadir, "output.pdf", self.data)
output = self.pdfjinja(self.data) output = self.pdfjinja(self.data)
outfile = BytesIO() outfile = BytesIO()
output.write(outfile) output.write(outfile)