summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2011-02-26 03:08:58 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2011-02-26 03:08:58 +0100
commit5b3ef3f317085a3f6cf8a319c7ac406047e49b78 (patch)
tree2a6001ff17e4b3b38708176f46ac78fbab83125b /ishtar/furnitures/views.py
parent7628e0523dea78b448fd2df5a353ae2a37f890ea (diff)
downloadIshtar-5b3ef3f317085a3f6cf8a319c7ac406047e49b78.tar.bz2
Ishtar-5b3ef3f317085a3f6cf8a319c7ac406047e49b78.zip
Better PDF export(refs #227)
Diffstat (limited to 'ishtar/furnitures/views.py')
-rw-r--r--ishtar/furnitures/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py
index e874e8cc2..59faeca47 100644
--- a/ishtar/furnitures/views.py
+++ b/ishtar/furnitures/views.py
@@ -290,11 +290,12 @@ def show_item(model, name):
response.write(odtfile)
return response
elif doc_type == 'pdf':
- tpl = loader.get_template('sheet_%s.html' % name)
+ tpl = loader.get_template('sheet_%s_pdf.html' % name)
content = tpl.render(context_instance)
result = StringIO.StringIO()
- pdf = pisa.pisaDocument(StringIO.StringIO(content.encode("utf-8")),
- result)
+ html = content.encode('utf-8')
+ html = html.replace("<table", "<pdf:nextpage/><table repeat='1'")
+ pdf = pisa.pisaDocument(StringIO.StringIO(html), result)
response = HttpResponse(result.getvalue(),
mimetype='application/pdf')
response['Content-Disposition'] = 'attachment; filename=%s.pdf' % \