Inconsistent Table Detection #1131
Replies: 2 comments 1 reply
-
Hi @dlasusa, and thanks for sharing this example. The bad news:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @jsvine ! I ended up iterating the pdf twice (with 2 different sets of table settings). The pass through I tracked which pages had no results, and the second pass, iterated just those pages and combined the results. I wasn't sure if I was doing something wrong. My first pass table settings: table_settings = {
"explicit_vertical_lines": [17, 528],
"horizontal_strategy": "lines",
"snap_y_tolerance": 10,
"intersection_tolerance": 10,
"join_tolerance": 300
} Second pass: table_settings2 = {
"explicit_vertical_lines": [17, 528],
"explicit_horizontal_lines": [60, 190],
"horizontal_strategy": "lines",
"snap_tolerance": 10,
"intersection_tolerance": 10,
"join_tolerance": 300
} By adding some Thank you for your suggestion and your time! |
Beta Was this translation helpful? Give feedback.
-
I don't think I can share the pdf since it's got police data in it, but I'm sharing images of the issue (I've removed some info from the images, but I don't think it's relevant).
In the PDF, when a page has multiple entries, it seems to detect the tables as expected. But if there is a single item, it puts a box around the item, but I don't get the blue "table" color.
What I expect:
![pdf_sample2](https://private-user-images.githubusercontent.com/36902797/325443760-f4a19a71-bdb3-490b-a43a-b8da4ee9034a.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMzU3NTEsIm5iZiI6MTcyNjAzNTQ1MSwicGF0aCI6Ii8zNjkwMjc5Ny8zMjU0NDM3NjAtZjRhMTlhNzEtYmRiMy00OTBiLWE0M2EtYjhkYTRlZTkwMzRhLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDA2MTczMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEzOTI0Njg5MGY3NTA1MDQ4YmIzMzhlZDhiZDA3MmJmNTJlMDAxMDdhM2NjMjMyYjQ3NDVmMjliMjg0NDJkOGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.6YmDjrp3GMuaWQhJ7xrWXYXqnBqZ-biY9gzMdGSvPkI)
When there is just one item:
![pdf_sample](https://private-user-images.githubusercontent.com/36902797/325443766-4fb8a960-0e50-4e29-b13f-bb098d962305.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMzU3NTEsIm5iZiI6MTcyNjAzNTQ1MSwicGF0aCI6Ii8zNjkwMjc5Ny8zMjU0NDM3NjYtNGZiOGE5NjAtMGU1MC00ZTI5LWIxM2YtYmIwOThkOTYyMzA1LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDA2MTczMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmODc0ZmNmNGQ1MzU1NmZhYjgwMTc2NzRmNGVlMjAwNThhMDU5MjdlYTZjYmU2ZWM2NjM0YWE1ZmUwZmU1NDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.YQnTfy5EZHquLGgW5OfxrwxF1pnQT9eu4zS_n2PTgfo)
Environment:
Win11
Python 3.12.2
pdfplumber 0.11.0
Beta Was this translation helpful? Give feedback.
All reactions