We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
page.get_text("blocks") has stopped working with the latest PyMuPDF version.
Below is a simple code snippet:
input_file = "my_pdf.pdf" doc = fitz.open(input_file) for page_no, page in enumerate(doc): print(page.get_text("blocks"))
With PyMuPDF version 1.22.2 the code prints:
[(0.0, 0.0, 273.6000061035156, 728.1599731445312, '<image: ICCBased(RGB,GIMP built-in sRGB), width: 1140, height: 3034, bpc: 8>', 0, 1)]
With PyMuPDF version 1.24.0 the code is not able to get anything.
1.24.0
MacOS
3.12
The text was updated successfully, but these errors were encountered:
We cannot accept a bug report without a reproducing file.
Sorry, something went wrong.
Please consult the documentation on text extraction flags and include TEXT_PRESERVE_IMAGES or use TEXTFLAGS_DICT as your flags value.
TEXT_PRESERVE_IMAGES
TEXTFLAGS_DICT
Thank you for your response. I see that we now have to necessarily use this flag for documents containing images.
Earlier, with version 1.22.2 the flag was not required explicitly,
With version 1.24.0, the same code block does extract the image information by default,
But it does when the flag is supplied,
No branches or pull requests
Description of the bug
page.get_text("blocks") has stopped working with the latest PyMuPDF version.
How to reproduce the bug
Below is a simple code snippet:
With PyMuPDF version 1.22.2 the code prints:
[(0.0, 0.0, 273.6000061035156, 728.1599731445312, '<image: ICCBased(RGB,GIMP built-in sRGB), width: 1140, height: 3034, bpc: 8>', 0, 1)]
With PyMuPDF version 1.24.0 the code is not able to get anything.
PyMuPDF version
1.24.0
Operating system
MacOS
Python version
3.12
The text was updated successfully, but these errors were encountered: