渲染图像并保存在HTML的PDF套件文件夹中

时间:2019-12-02 11:10:42

标签: python html pdf png pdfkit

以下所有内容均在python中

我创建了一些html文件,每个html文件都包含一个表格,几个div和一个png。

html文件中png的路径是这样的:

<img src = "C:/Users/jtimmins/Documents/FakeLibra/HTMLs/Logos/Test.png" alt = "Picture of a happy monkey" height="25%"/>

但是,当我随后使用以下代码时:

config = pdfkit.configuration(wkhtmltopdf="C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe")
pdfkit.from_file(f, 'PDFs/{0}.pdf'.format(filename.split('.')[0]), configuration=config)

pdf是由表格和div生成的,但没有png,我该怎么办才能使png呈现?

0 个答案:

没有答案