aboutsummaryrefslogtreecommitdiffstats
path: root/wkhtmltopdf/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'wkhtmltopdf/utils.py')
-rw-r--r--wkhtmltopdf/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py
index d0475c4..03a5f82 100644
--- a/wkhtmltopdf/utils.py
+++ b/wkhtmltopdf/utils.py
@@ -19,6 +19,8 @@ def _options_to_args(**options):
flags = []
for name in sorted(options):
value = options[name]
+ if value is None:
+ continue
flags.append('--' + name.replace('_', '-'))
if value is not True:
flags.append(unicode(value))
@@ -38,11 +40,17 @@ def wkhtmltopdf(pages, output=None, **kwargs):
{'footer_html': 'http://example.com/foot.html'}
becomes
'--footer-html http://example.com/foot.html'
+
Where there is no value passed, use True. e.g.:
{'disable_javascript': True}
becomes:
'--disable-javascript'
+ To disable a default option, use None. e.g:
+ {'quiet': None'}
+ becomes:
+ ''
+
example usage:
wkhtmltopdf(pages=['/tmp/example.html'],
dpi=300,