Code stops running while using color_topusage() #2575
-
Have used the below PDF for identifying background color of the bbox provided in code. The code execution is failing. Can you please let me |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
import fitz |
Beta Was this translation helpful? Give feedback.
-
Thanks for explaining and the code. My objective is to take span["bbox"] values to identify background color of text. Could you let me know if it is possible without making a new version of PDF and using page.search_for()? |
Beta Was this translation helpful? Give feedback.
-
Can you let me know how a bounding box can be drawn around rotated text in a PDF. For example, in the above PDF, "The Majestic" is rotated. |
Beta Was this translation helpful? Give feedback.
It is of no importance, from where you get the bbox whose background color you need.
My code above only shows how to avoid the fairly confusing handling of page rotations. But you can also do this: