From d0c76c4fa3c03e4fbb3855621516f1338d52d998 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sat, 29 Aug 2020 14:11:21 +0200 Subject: wait to render pdf for js to load --- server/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/views.py b/server/views.py index 26d5b2a..b5e0493 100644 --- a/server/views.py +++ b/server/views.py @@ -221,7 +221,7 @@ def ulist(request): # render context html = template.render(context) # render pdf using wkhtmltopdf - pdf = pdfkit.from_string(html, False) + pdf = pdfkit.from_string(html, False, options={'javascript-delay':'1000'}) result = BytesIO(pdf) result.seek(0) @@ -602,7 +602,7 @@ def doclist(request): context = {'doc': doc, 'vac': vac_file, 'health': health_file, 'sign_doc_file': sign_doc_file} html = template.render(context) - pdf = pdfkit.from_string(html, False) + pdf = pdfkit.from_string(html, False, options={'javascript-delay':'1000'}) result = BytesIO(pdf) result.seek(0) -- cgit v1.2.1