-
Notifications
You must be signed in to change notification settings - Fork 556
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
insert_htmlbox error: int too large to convert to float #3916
Comments
This addresses #3916.
Thanks for the detailed report, i was able to reproduce it easily. It's a bug in I have a fix in my tree. |
This addresses #3916.
Hi Juilan, Thanks so much for the quick response and fix. Really appreciate it. Will this be released soon? |
I'm hoping to make a new release this week, but it's quite likely to be delayed until sometime next week. |
Fixed in 1.24.12. |
Description of the bug
Hi,
I am using the PyMuPDF library to translate pdfs keeping the overall structure intact. Now, this has been working successfully but while trying to translate an RTL langue. I got this error in processing the pdf on insert_htmlbox function.
The bbox for which this occured is:
I tried to round off the values to 2 decimal places even but still got the same issue. This bbox value is gotten using this code snippet:
Note that is value of bbox works:
Only difference is the third value's whole part so I am unsure what exactly are the constraints here.
How to reproduce the bug
Code to reproduce output:
test file:
Getting error when using file directly as:
Error processing block: 'ر' with bbox: [393.83990478515625, 245.69000244140625, 393.83990478515625, 256.7300109863281]
'NoneType' object has no attribute 'y1'
Error processing block: 'NoneType' object has no attribute 'y1'
'NoneType' object has no attribute 'y1'
but when I use a file stream which I use on prod, I get:
Error processing block: 'ر' with bbox: [393.83990478515625, 245.69000244140625, 393.83990478515625, 256.7300109863281]
int too large to convert to float
file: test.pdf
PyMuPDF version
1.24.11
Operating system
Linux
Python version
3.10
The text was updated successfully, but these errors were encountered: