[Answer]-Generate pdf with reportlab

1👍

The coordinates for “Address” and “School” are simply outside of the page. The origin of the reportlab coordinate system is bottom-left, with the x coordinate going to the right and the y coordinate going up. Try the following instead:

p.drawString(10, 800, "Name")
p.drawString(10, 790, "Address")
p.drawString(10, 780, "School")
👤sk1p

0👍

So this works. Just gave smaller values to y co-ordinates. Try playing with these values according to your needs.

p = canvas.Canvas(response)
p.drawString(10,750,'Name')
p.drawString(10,650,'Address')
p.drawString(10,550,"School")
p.showPage()
p.save()
👤zephyr

Leave a comment