手记

python生成一个简单的pdf文件

from reportlab.graphics.shapes import Drawing, String
from reportlab.graphics import renderPDF

d = Drawing(200, 200)
s = String(50, 50, 'victor is a good man', textAncher='middle')

d.add(s)
renderPDF.drawToFile(d, r'd:\victor.pdf', 'simple pdf')

0人推荐
随时随地看视频
慕课网APP