diff options
Diffstat (limited to 'ishtar/furnitures/views.py')
| -rw-r--r-- | ishtar/furnitures/views.py | 7 |
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' % \ |
