From a1a701dad95a22bc9f2be8ccfeceda704d971887 Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 21 Jun 2011 01:56:58 +0530 Subject: [PATCH] and now for something completely different --- edgware/editor/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/edgware/editor/views.py b/edgware/editor/views.py index b2bd9ff..252adac 100644 --- a/edgware/editor/views.py +++ b/edgware/editor/views.py @@ -641,17 +641,19 @@ def product_pdf(request): def article_pdf(request): a_id = request.GET['id'] article = get_object_or_404_json(Article, pk=a_id) - dpi = request.GET.get('dpi', 200) + dpi = request.GET.get('dpi', 300) width_mm = request.GET.get('width', article.typ.print_width) height_mm = math.ceil(width_mm // article.typ.aspect_ratio) pages = Page.objects.filter(article=article).order_by('page_no') m = article.get_print_multiplier(dpi) url = SITE_BASE + "/edit/view_article/%d/?m=%f" % (article.id, m) -# url_list = [url] + url_list = [url] + ''' url_list = [] for p in pages: url = SITE_BASE + "/edit/view_article/%d/?m=%f&p=%d" % (article.id, m, p.id) url_list.append(url) + ''' output_path = MEDIA_ROOT + "/pdf/" + article.name + "_" + str(article.current_revision()) + ".pdf" pdf_path = print_url_list(url_list, width_mm, height_mm, dpi, output_path) return HttpResponseRedirect(pdf_path.replace(MEDIA_ROOT, "/static"))