def test_04_canvasMethods(self):
from reportlab.lib.pagesizes import A4
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.units import inch
c = Canvas('demo.pdf', pagesize=A4)
c.translate(inch,inch)
c.setFont("Helvetica", 14)
c.setAuthor("JY.zenist.song")
c.setTitle("Hello ReportLib")
c.drawString(3*inch, 3*inch, "Hello World")
c.showPage()
c.save()
评论列表
文章目录