我想将Pandas数据框保存为PDF格式。
import pdfkit as pdf
config = pdf.configuration(wkhtmltopdf="C:\Program Files\wkhtmltopdin\wkhtmltopdf.exe")
pdf.from_url('http://google.com', 'out.pdf',configuration=config)
--> not working somehow even though I downloaded wkhtmltopdin on several different locations
from weasyprint import HTML
HTML(string=pd.read_csv('cor.csv').to_html()).write_pdf("report.pdf")
dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2
--> not working : Tried several times to solve this isseue, but cannot download library
我在stackoverflow和其他网站上尝试了5个以上的软件包和方法,但是无法解决问题。
还有没有更多的软件包可以尝试?这让我很烦恼。
提前感谢。