Skip to content

Is there a way to define cells by cell color? #601

Answered by jsvine
YeHW asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @YeHW, and thanks for your interest in this library. Unfortunately, it is very difficult to help with a PDF based only on a screenshot, since it describes very little of the actual underlying structure of the PDF. Are you able to share that, or a version redacted via https://github.com/JoshData/pdf-redactor?

I am wondering if there is a way that supports defining cells by their color?

There is not currently a way to incorporate rectangle color information in .extract_text(), but you could write custom code to examine the non_stroking_color attributes of all page.rects objects, and then use that information to inform your table-extraction strategy.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YeHW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
awaiting-code-or-pdf Issues and PRs awaiting code and/or a PDF from issue/PR-author
3 participants