-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent image extraction from image-only PDFs #155
Comments
Please provide a reproducer. |
Sure, on this PDF for example, some of the images extracted are going to be only isolated words, and the right text from the third page is also missing : first_three_pages_full_images.pdf I'm using :
|
i'm having the same issue when extracting pdfs only with images. |
Are there currently any solutions out there for dealing with image-based pdfs (e.g. scanned documents)? Is there existing documentation on how to use this with the OCR functionality from PyMuPDF? |
First of all, I'd like to mention that pymupdf4llm works very well for most use cases. I'm using the to_markdown function, which performs exactly as expected. Great work!
However, I've encountered an issue with PDFs that contain only images (though I am not entirely sure if this issue is directly related to the fact that the PDFs consist solely of images). In these cases, some images are missing from the output. Additionally, when an image contains text, instead of extracting the image as a whole, the library splits the image into multiple smaller images, each containing only one word.
Problems observed:
single word.
I am unsure whether there is a way to merge these smaller images into one or if this behavior is caused by pymupdf4llm or the PDF format itself, which I understand can be quite complex to handle.
I am using write_images = True and have tried lowering the image_size_limit to a very small value, but this did not resolve the issue.
Thanks for your help,
Cozokim
The text was updated successfully, but these errors were encountered: