Automatically detect and extract tables from PDF files

Hi, my task is:

  • Automatically detect tables within pdf documents
  • Extract them to Excel

How should I approach this problem without hard coding the instructions/selectors on where to find the tables? It should intelligently detect any tables from any pdf file that is specified as input