Skip to content

Commit 736b217

Browse files
committed
update README
1 parent 68d259b commit 736b217

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ Also you can pass an opened file:
5757
with open('file.html') as f:
5858
pdfkit.from_file(f, 'out.pdf')
5959
60+
If you wish to further process generated PDF, you can read it to a variable:
61+
62+
.. code-block:: python
63+
64+
# Use False instead of output path to save pdf to a variable
65+
pdf = pdfkit.from_url('http://google.com', False)
66+
6067
You can specify all wkhtmltopdf `options <http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf_0.10.0_rc2-doc.html>`_. You can drop '--' in option name. If option without value, use *None, False* or *''* for dict value:
6168

6269
.. code-block:: python
@@ -73,6 +80,15 @@ You can specify all wkhtmltopdf `options <http://madalgo.au.dk/~jakobt/wkhtmltox
7380
7481
pdfkit.from_url('http://google.com', 'out.pdf', options=options)
7582
83+
By default, PDFKit will show all ``wkhtmltopdf`` output. If you dont want it, you need to pass ``quiet`` option:
84+
85+
.. code-block:: python
86+
87+
options = {
88+
'quiet': ''
89+
}
90+
91+
pdfkit.from_url('google.com', 'out.pdf', options=options)
7692
7793
Due to wkhtmltopdf command syntax, **TOC** and **Cover** options must be specified separately:
7894

0 commit comments

Comments
 (0)