try setting dpi
This commit is contained in:
parent
08138cf2dd
commit
0bb0255531
|
@ -1,10 +1,10 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def print_url_list(urls, width, height, output_path):
|
def print_url_list(urls, width, height, dpi, 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 -d %d %s '%s'" % (width, height, dpi, " ".join(clean_urls), output_path,)
|
||||||
# print cmd
|
# print cmd
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
return output_path
|
return output_path
|
||||||
|
|
|
@ -592,7 +592,7 @@ def article_pdf(request):
|
||||||
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"
|
||||||
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"))
|
return HttpResponseRedirect(pdf_path.replace(MEDIA_ROOT, "/static"))
|
||||||
|
|
||||||
def article_json(request):
|
def article_json(request):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user