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')
转载于:https://blog.51cto.com/victor2016/2108522