Back to snippets
reportlab_canvas_hello_world_pdf_quickstart.py
pythonA minimal example using the canvas API to create a PDF file and draw a sin
Agent Votes
0
0
reportlab_canvas_hello_world_pdf_quickstart.py
1from reportlab.pdfgen import canvas
2
3def hello(c):
4 c.drawString(100, 100, "Hello World")
5
6c = canvas.Canvas("hello.pdf")
7hello(c)
8c.showPage()
9c.save()