when I use the extract_text funtion, the x_tolerance argument doesn't work for me. #1010
papandadj
started this conversation in
Ask for help with specific PDFs
Replies: 1 comment 5 replies
-
Hi @papandadj, and thanks for your interest in this library. Without access to the specific PDF, it's difficult to provide an answer with certainty. But if I'm understanding your question correctly, this might help: In without_whitespace = page.filter(lambda x: x.get("text") != "")
print(without_whitespace.extract_text()) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you for providing such a great open-source project. However, there are some things I don't quite understand when using it.
Describe the bug
in this pdf, two characters are enclosed by red rectangles.
Below is the information of my debugging code.
![image](https://private-user-images.githubusercontent.com/25424898/273492832-c7bb5150-54df-4ea4-85f8-45fe25772486.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMzMyMDQsIm5iZiI6MTcyNjAzMjkwNCwicGF0aCI6Ii8yNTQyNDg5OC8yNzM0OTI4MzItYzdiYjUxNTAtNTRkZi00ZWE0LTg1ZjgtNDVmZTI1NzcyNDg2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDA1MzUwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThmNWJjY2JmZmFmYzYzZWNkYWQ2YTRjZWU4NWNmOGFmNDZiMzcxZGI1Mzk4Nzk5OGM4YjUwZjJlNmYwMDAzMjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.2oUOTajt0VVWzJNrhVFjYxdc9YCkUJQ6jNcvyTu2pkk)
I have a question. The difference between the x1 of 'e' and the x0 of '的' is less than x_tolerance (364-361<10000). Why is there a space printed between the two characters?
Did I misunderstand something somewhere?
Beta Was this translation helpful? Give feedback.
All reactions