Open Cozokim opened 1 month ago
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 :
pdf = "data\pdf\first_three_pages_full_images.pdf"
doc = fitz.open(pdf)
md_text = to_markdown(doc, write_images=True,image_size_limit=0.001)
i'm having the same issue when extracting pdfs only with images.
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:
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