Skip to content

find_tables() 'cells' attributes format #3629

Closed Answered by JorjMcKie
isaac-peter asked this question in Looking for help
Discussion options

You must be logged in to vote

This has been answered in #3587. E.g.

imglist = page.get_image_info()

# copy of the table's text content:
tab_text = tab.extract()[:]
# the table's cell bboxes as Rect objects:
tab_cells=[[pymupdf.Rect(c) for c in r.cells] for r in tab.rows]

Are 2 lists of lists with the same sizes and indexed as [row][col]. So the text in tab_text[row][col] has the cell coordinates tab_cells[row][col] (which is a Rect object).

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@isaac-peter
Comment options

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