Skip to content
Discussion options

You must be logged in to vote

Hello, there is method page.get_drawings() which returns lines, rectangles, curves together with any fill colors.
So you can look for a rectangle in that list of dictionaries. In your case it should indeed have a fill color and be large enough, etc.
Then take that rect as the clip parameter in page.get_text(option, clip=rect, ...more args).

This are only slightly different if the background was not created by PDF drawings but by embedded images (which is rare).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@maiiabocharova
Comment options

@JorjMcKie
Comment options

Answer selected by maiiabocharova
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants