
# -*- coding:utf-8 -*-
import pdfkit
path_wk = r'C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe' # Change to the location where you installed it
config = pdfkit.configuration(wkhtmltopdf=path_wk)
pdfkit.from_string("string",'jmeter_download file1.pdf', configuration=config) # string
# pdfkit.from_url("www.baidu.com",'jmeter_download file 2.pdf', configuration=config) # website link
# pdfkit.from_file("./file name.html",'jmeter_download file 3.pdf', configuration=config) # file name is best not to use Chinese
Remember to install pdfkit pip install pdfkit
pdfkit.from_stringpdfkit.from_urlpdfkit.from_file


When writing code documents in jupyter notebook, sometimes you need to export the pdf version, but jupyter will report an error. I was thinking that apart from the online debug method, there is no oth...
Pdfkit (https://pypi.org/project/pdfkit/ ) Python 2 and 3 wrapper for wkhtmltopdf utility to convert HTML to PDF using Webkit. Install: PIP Install Pdfkit is installed ( )。 Note: The too...
1, PDFKIT installation 2, Python uses PDFKIT, call pdfkit.from_string, etc., the following error will occur. And if you use PIP InstallwkhtmltopdfThis problem occurs if it is installed. 3, download th...
Summary: Summary: Cottage processing: Flask client uploads files, read the FileStorage stream object, transform the stream object into string type, convert HTML content into a PDF file via the PDFKIT ...
Articles directory Python package-PDFKIT converts HTML to PDF What is pdfkit Install use Generate URL PDF file String generates pdf [pdfkit.from_string () function] Report an error Error oserror: no w...
The value and gains of this article After reading this article, you will be able to make the following interface [email protected] Jietu20200510-110903.gif Basic knowledge (master can skip, ...
Python's third-party library pdfkit can generate pdf files from web pages, html files and strings. Install related dependencies 1.python version 3.x, type in the command linepip install pdfkit 2. Inst...
Article catalog Foreword First look at the results map First, install the necessary software Second, open code Introduced 2. Guide 3. Worse website 4. Create an object HTP 5. Get link Idea: 6. Get the...
PDFKIT module installation example 1: run Code Example 2 run Code...
principle: Using Selenium + Chromedriver opens the page, get the HTML source, then use PDFKIT to generate PDF concept: Selenium: Selenium is a tool for web application testing. Selenium test is...