0

I have a pdf file which contains some lines (not text) with different line width. I need to extract the co-ordinates of the starting and ending of those lines. Is it possible to do this using python. Any help will be really helpful.

Please note I don't need to extract text. I need to extract the lines.

  • Have you tried inkscape or something similar? https://stackoverflow.com/questions/10288065/convert-pdf-to-clean-svg I guess you would want to extract the lines from a SVG file – Timothy Dalton Dec 28 '20 at 08:31
  • @Timothy Dalton I need to extract lines from pdf and not from svg. Also I'm not familiar with inkscape. If you give some overview, it will be helpful. – ArunK769 Dec 28 '20 at 08:56
  • I would try and convert the pdf to an svg with Inkscape and see if you can select the lines then. – Timothy Dalton Dec 28 '20 at 09:01
  • It is theoretically possible. You would have to parse the compressed PostScript that the `.pdf` format uses and pick out the commands that draw the lines. Writing such a parser would be a significant project. – BoarGules Dec 28 '20 at 09:15

0 Answers0