from reportlab.pdfgen.canvas import Canvas from reportlab.pdfbase import pdfmetrics canvas = Canvas("test.pdf") canvas.line(50, 380, 560, 380)