如何在Python中从HTML/CSS(包括图像)源生成PDF?

如何在Python中从HTML/CSS(包括图像)源生成PDF?

问题描述:

假设我有一个HTML/CSS页面,其中包含一些图像,我想用Python从该源生成PDF-可能吗?

Let's say I've got an HTML / CSS page with some images in it, and I wanted to generate a PDF from that source in Python - possible?

http://www.xhtml2pdf.com/

安装对我来说有点古怪,但否则效果很好.

install was a little quirky for me, but otherwise it worked fine.