From 7a4f4fcbc94372a06def6939e1a84538b5815cce Mon Sep 17 00:00:00 2001 From: sanj Date: Wed, 28 Jul 2010 23:22:21 +0530 Subject: [PATCH] print maybe fixed? --- edgware/editor/print_pdf.py | 3 ++- edgware/editor/views.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/edgware/editor/print_pdf.py b/edgware/editor/print_pdf.py index 03f66b7..8c41daa 100644 --- a/edgware/editor/print_pdf.py +++ b/edgware/editor/print_pdf.py @@ -4,6 +4,7 @@ def print_url_list(urls, width, height, output_path): clean_urls = [] for u in urls: clean_urls.append(u) - cmd = "wkhtmltopdf --page-width %d --page-height %d %s %s" % (width, height, " ".join(clean_urls), output_path,) + cmd = "wkhtmltopdf --page-width %d --page-height %d %s '%s'" % (width, height, " ".join(clean_urls), output_path,) + print cmd os.system(cmd) return output_path diff --git a/edgware/editor/views.py b/edgware/editor/views.py index e6d98d1..6ac8108 100644 --- a/edgware/editor/views.py +++ b/edgware/editor/views.py @@ -586,9 +586,9 @@ def article_pdf(request): m = article.get_print_multiplier(dpi) url_list = [] for p in pages: - url = SITE_BASE + "/edit/view_article/%d/?m=%f&p=%d'" % (article.id, m, article.product.id) + url = SITE_BASE + "/edit/view_article/%d/?m=%f" % (article.id, m) url_list.append(url) - output_path = MEDIA_ROOT + "/pdf/" + article.name + "_" + str(article.current_revision()) + ".pdf" + output_path = MEDIA_ROOT + "/pdf/" + article.name + "_" + str(article.current_revision()) + ".pdf".replace(" ", "") pdf_path = print_url_list(url_list, width_mm, height_mm, output_path) return HttpResponseRedirect(pdf_path.replace(MEDIA_ROOT, "/static"))