1

Is there a way to draw lines on a PDF file, by giving it coordinates of the start and end points? I have tried PyFPDF but cannot find much documentation about implementing it.

user840
  • 134
  • 1
  • 13
  • try `reportlab` with `canvas.line(378,723,580,723)` https://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/ – Epsi95 Dec 03 '21 at 05:24

1 Answers1

0

The following code will draw a line in pdf:

pdf.set_draw_color(0, 0, 0) #black line
pdf.line(5, 16,205 ,16) #coordinate sequence: (x_start, y_start, x_end, y_end)
asif abdullah
  • 250
  • 3
  • 16