55
66
77def from_url (url , output_path = None , options = None , toc = None , cover = None ,
8- configuration = None , cover_first = False , verbose = False ):
8+ configuration = None , cover_first = False , verbose = False , timeout = None ):
99 """
1010 Convert file of files from URLs to PDF document
1111
@@ -17,18 +17,19 @@ def from_url(url, output_path=None, options=None, toc=None, cover=None,
1717 :param configuration: (optional) instance of pdfkit.configuration.Configuration()
1818 :param cover_first: (optional) if True, cover always precedes TOC
1919 :param verbose: (optional) By default '--quiet' is passed to all calls, set this to False to get wkhtmltopdf output to stdout.
20+ :param timeout: (optional) if passed, uses this timeout value (in seconds) for the wkhtmltopdf command
2021
2122 Returns: True on success
2223 """
2324
2425 r = PDFKit (url , 'url' , options = options , toc = toc , cover = cover ,
25- configuration = configuration , cover_first = cover_first , verbose = verbose )
26+ configuration = configuration , cover_first = cover_first , verbose = verbose , timeout = timeout )
2627
2728 return r .to_pdf (output_path )
2829
2930
3031def from_file (input , output_path = None , options = None , toc = None , cover = None , css = None ,
31- configuration = None , cover_first = False , verbose = False ):
32+ configuration = None , cover_first = False , verbose = False , timeout = None ):
3233 """
3334 Convert HTML file or files to PDF document
3435
@@ -41,18 +42,19 @@ def from_file(input, output_path=None, options=None, toc=None, cover=None, css=N
4142 :param configuration: (optional) instance of pdfkit.configuration.Configuration()
4243 :param cover_first: (optional) if True, cover always precedes TOC
4344 :param verbose: (optional) By default '--quiet' is passed to all calls, set this to False to get wkhtmltopdf output to stdout.
45+ :param timeout: (optional) if passed, uses this timeout value (in seconds) for the wkhtmltopdf command
4446
4547 Returns: True on success
4648 """
4749
4850 r = PDFKit (input , 'file' , options = options , toc = toc , cover = cover , css = css ,
49- configuration = configuration , cover_first = cover_first , verbose = verbose )
51+ configuration = configuration , cover_first = cover_first , verbose = verbose , timeout = timeout )
5052
5153 return r .to_pdf (output_path )
5254
5355
5456def from_string (input , output_path = None , options = None , toc = None , cover = None , css = None ,
55- configuration = None , cover_first = False , verbose = False ):
57+ configuration = None , cover_first = False , verbose = False , timeout = None ):
5658 """
5759 Convert given string or strings to PDF document
5860
@@ -65,12 +67,13 @@ def from_string(input, output_path=None, options=None, toc=None, cover=None, css
6567 :param configuration: (optional) instance of pdfkit.configuration.Configuration()
6668 :param cover_first: (optional) if True, cover always precedes TOC
6769 :param verbose: (optional) By default '--quiet' is passed to all calls, set this to False to get wkhtmltopdf output to stdout.
70+ :param timeout: (optional) if passed, uses this timeout value (in seconds) for the wkhtmltopdf command
6871
6972 Returns: True on success
7073 """
7174
7275 r = PDFKit (input , 'string' , options = options , toc = toc , cover = cover , css = css ,
73- configuration = configuration , cover_first = cover_first , verbose = verbose )
76+ configuration = configuration , cover_first = cover_first , verbose = verbose , timeout = timeout )
7477
7578 return r .to_pdf (output_path )
7679
0 commit comments