Skip to content
Discussion options

You must be logged in to vote

Yes, that is what I was referring to!
These are drawings. They will not be contained in any page.get_text().
Method page.get_drawings() extracts them - together with other drawing items like rectangles, curves and so on.
You could select these items like this:

>>> doc=fitz.open("test.pdf")
>>> page=doc[0]
>>> paths=page.get_drawings()  # get all drawing items
>>> limit=page.rect.width/2  # only select shorter items
>>> height = 2  # only select lower items
>>> for p in paths:
	if p["rect"].height <= 2 and p["rect"].width < limit:
		page.draw_rect(p["rect"], color=(1,0,0))

		
Point(53.858299255371094, 500.12969970703125)
Point(53.858299255371094, 689.8663940429688)
Point(319.2283020019531, 

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #1585 on February 06, 2022 02:13.