print maybe fixed?

This commit is contained in:
sanj 2010-07-28 23:22:21 +05:30
parent 7316898e56
commit 7a4f4fcbc9
2 changed files with 4 additions and 3 deletions

View File

@ -4,6 +4,7 @@ def print_url_list(urls, width, height, output_path):
clean_urls = [] clean_urls = []
for u in urls: for u in urls:
clean_urls.append(u) 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) os.system(cmd)
return output_path return output_path

View File

@ -586,9 +586,9 @@ def article_pdf(request):
m = article.get_print_multiplier(dpi) m = article.get_print_multiplier(dpi)
url_list = [] url_list = []
for p in pages: 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) 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) pdf_path = print_url_list(url_list, width_mm, height_mm, output_path)
return HttpResponseRedirect(pdf_path.replace(MEDIA_ROOT, "/static")) return HttpResponseRedirect(pdf_path.replace(MEDIA_ROOT, "/static"))