-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.py
31 lines (23 loc) · 1.08 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python2
# -*- coding: utf-8 -*-
from fonts import fonts
from data import adv_text
from data import reg_text
from templates import horeca
import grid.generic
import frame.generic
import generator.page_layout
import os
from reportlab.lib.units import mm
page_size = [210,297]
pdf_dir = (os.path.join(os.getcwd(),'out/pdf'))
offer_data = reg_text.init('/home/raven/gen_projects/horeca_24/imageDB/','/home/raven/gen_projects/horeca_24/data')
fonts.init()
for page_number,page_offers in offer_data.iteritems():
print page_offers
template = horeca.init(page_size)
template = grid.generic.init(template,page_offers)
template = frame.generic.init(template)
generator.page_layout.layout(template,page_size,'/home/raven/git/pages/imageDb/','/home/raven/git/pages/out/pdf2/',str(page_number) + '_test_1.pdf')
#command = 'pdfunite $(ls ' + '/home/raven/git/pages/out/pdf2/' + ') out.pdf && gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dTextAlphaBits=2 -dGridFitTT=1 -dColorImageResolution=320 -sOutputFile=out_light.pdf out.pdf'
#os.popen(command)