Installing pdfkit is as simple as
$ pip install pdfkitThen you can do this:
import pdfkit pdfkit.from_url('http://google.com', 'out1.pdf') pdfkit.from_file('test.html', 'out2.pdf') # Provided you have test.html in your current folder pdfkit.from_string('Hello!', 'out3.pdf') pdfkit.from_string('<html><table><tr><th>Header</th></tr><tr><td>Row 1<td></tr><tr><td>Row 2<td></tr></table></html>', 'out4.pdf')
No comments:
Post a Comment