学习Python在使用ReporLab 画图 ,保存成PDF时候遇到了点问题。记录下来
环境:
开发工具(IDE) : JetBrains PyCharm Community Edition 2016.3.2
操作系统(System): windows 7 X64
Python: 3.6.0
Project A :A simple pdf file
Code:
from reportlab.graphics.shapes import Drawing,Stringfrom reportlab.graphics import renderPDFd = Drawing (100,100)s= String (50,50,'Hello World !',textAnchor ='middle')d.add(s)renderPDF.drawToFile(d,'hello.pdf','A simple pdf file')
Expected output: