pdfplumber
Plumb a PDF for detailed information about each char, rectangle, line
...Users can extract text while preserving layout information and identify tables through configurable detection strategies. The library supports page cropping, object filtering, and visual debugging tools that display detected elements and table boundaries. It also provides access to PDF metadata and password-protected documents. A command-line interface exports page objects into structured CSV or JSON data. pdfplumber works best with digitally generated PDFs and is useful for document analysis, data extraction, and automated processing workflows.