try setting dpi

This commit is contained in:
sanj 2010-07-29 01:40:23 +05:30
parent 08138cf2dd
commit 0bb0255531
2 changed files with 3 additions and 3 deletions

View File

@ -1,10 +1,10 @@
import os
def print_url_list(urls, width, height, output_path):
def print_url_list(urls, width, height, dpi, 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 -d %d %s '%s'" % (width, height, dpi, " ".join(clean_urls), output_path,)
# print cmd
os.system(cmd)
return output_path

View File

@ -592,7 +592,7 @@ def article_pdf(request):
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, output_path)
pdf_path = print_url_list(url_list, width_mm, height_mm, dpi, output_path)
return HttpResponseRedirect(pdf_path.replace(MEDIA_ROOT, "/static"))
def article_json(request):