Inconsistent table detection due to colours / layout #1119
jameskohjunwei
started this conversation in
Ask for help with specific PDFs
Replies: 1 comment 1 reply
-
Happy to hear that |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey @jsvine ,
Thank you for creating this library, i've been a user for a while - here to ask a specific question about this pdf i came accross.
I've got a PDF where rows are visually segmented by color (a faint purple every alternate row). I assume pdfplumber detects this color to identify rows for extraction. The issue arises when some pages start without this purple row segmentation - in those cases, detection is missed, and the rows don't get extracted. Is there a solution to this without explicitly hardcoding horizontal lines?
PDF here jpy_statement1-redacted_removed.pdf
Any assistance would be greatly appreciated. Thank you!
Image 1: example of rows starting without purple colour row and gets missed out in the detection.
![image](https://private-user-images.githubusercontent.com/60392496/321471648-f6a078cb-4e9b-4c80-99c6-0e59ceae4f44.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMzY3OTksIm5iZiI6MTcyNjAzNjQ5OSwicGF0aCI6Ii82MDM5MjQ5Ni8zMjE0NzE2NDgtZjZhMDc4Y2ItNGU5Yi00YzgwLTk5YzYtMGU1OWNlYWU0ZjQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDA2MzQ1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZhY2VjMGYxZTdmZDQzZmRkZGNmY2VlZjI3YjIzMzQyNzQ4YzA2NWM4N2FjNGQwYzY1MTU5ZmNiODkzMWU3YjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.yb7baQY_24sP71R3zYTTEyvECWcEAZOzm9lOP3LzS9c)
Image 2: example of row starting WITH purple colour row and gets picked up successfully.
![image](https://private-user-images.githubusercontent.com/60392496/321471794-d03adafe-9126-409c-94da-aed3eda8db69.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMzY3OTksIm5iZiI6MTcyNjAzNjQ5OSwicGF0aCI6Ii82MDM5MjQ5Ni8zMjE0NzE3OTQtZDAzYWRhZmUtOTEyNi00MDljLTk0ZGEtYWVkM2VkYThkYjY5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDA2MzQ1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZhOWZlMWUzYzRiZTJlMzkyNTY5MzFjZWFhNzBmMmVlNTM3MmVjNjc0ZjUwNjNjOTA5MjgyOTE2M2E0YzRiZTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.n1wnKrFYwS09TC_rk0jrM8tXaf530wNahxKBje1PKnY)
My code below:
Beta Was this translation helpful? Give feedback.
All reactions