TG-48 readme
This commit is contained in:
parent
ed0f2b1808
commit
58f9a6eebe
@ -8,6 +8,25 @@ Required :
|
||||
|
||||
* 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
|
||||
|
||||
Si vous utilisez un virtualenv :
|
||||
|
@ -5,7 +5,8 @@ import os
|
||||
|
||||
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
|
||||
:param dirname_template: chemin du fichier de template
|
@ -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
|
@ -3,3 +3,4 @@ flask-script < 2.1
|
||||
flask-sqlalchemy < 2.2
|
||||
flask-restful < 0.4
|
||||
mysqlclient < 1.4
|
||||
pdfjinja < 1.1
|
@ -1,12 +1,11 @@
|
||||
import json
|
||||
import os
|
||||
import unittest
|
||||
from io import BytesIO
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from pdfjinja import PdfJinja
|
||||
|
||||
from app.tools.pdfjinja.insertTemplate import remplirTemplate
|
||||
from app.tools.insertTemplate import remplir_template
|
||||
|
||||
|
||||
class insertTemplateTestCase(unittest.TestCase):
|
||||
@ -39,7 +38,7 @@ class insertTemplateTestCase(unittest.TestCase):
|
||||
del self.pdfjinja
|
||||
|
||||
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)
|
||||
outfile = BytesIO()
|
||||
output.write(outfile)
|
||||
|
Reference in New Issue
Block a user