Skip to content

Commit 9a342db

Browse files
committed
update readme
1 parent 0add46e commit 9a342db

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ You can pass a list with multiple URLs or files:
4646
pdfkit.from_url(['google.com', 'yandex.ru', 'engadget.com'], 'out.pdf')
4747
pdfkit.from_file(['file1.html', 'file2.html'], 'out.pdf')
4848
49+
Also you can pass an opened file:
50+
51+
.. code-block:: python
52+
53+
with open('file.html') as f:
54+
pdfkit.from_file(f, 'out.pdf')
55+
4956
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:
5057

5158
.. code-block:: python
@@ -123,3 +130,7 @@ Troubleshooting
123130
- ``IOError: 'No wkhtmltopdf executable found'``:
124131

125132
Make sure that you have wkhtmltopdf in your `$PATH` or set via custom configuration (see preceding section). *where wkhtmltopdf* in Windows or *which wkhtmltopdf* on Linux should return actual path to binary.
133+
134+
- ``IOError: 'Command Failed'``
135+
136+
This error means that PDFKit was unable to process an input. You can try to directly run a command from error message and see what error caused failure (on some wkhtmltopdf versions this can be cause by segmentation faults)

0 commit comments

Comments
 (0)