is there any way to find text using dimensions using pymupdf?
Question:
import fitz
doc = fitz.open(""
List item
)
for page in doc:
print(page.search_for("Bank Account"))
this program is for get dimensions of given text. i want to do reverse of it, find text using its dimensions.
Answers:
import fitz
doc = fitz.open("")
rect = fitz.Rect(value) #add dimension in place of value
for page in doc:
print(page.get_textbox(rect))
1.) First get the rectangular coordinates rect(x_0,y_0,x_1,y_1)
of the text you want to extract.
2.) Use the syntax Page.get_text("text",clip=rect)
. Place you rectangular coordinates into the clip.
For more go to the link.
import fitz
doc = fitz.open(""
List item
)
for page in doc:
print(page.search_for("Bank Account"))
this program is for get dimensions of given text. i want to do reverse of it, find text using its dimensions.
import fitz
doc = fitz.open("")
rect = fitz.Rect(value) #add dimension in place of value
for page in doc:
print(page.get_textbox(rect))
1.) First get the rectangular coordinates rect(x_0,y_0,x_1,y_1)
of the text you want to extract.
2.) Use the syntax Page.get_text("text",clip=rect)
. Place you rectangular coordinates into the clip.
For more go to the link.