Skip to content

Handle hidden text - #243

Draft
lfoppiano wants to merge 2 commits into
masterfrom
bugfix/remove-hidden-text
Draft

Handle hidden text#243
lfoppiano wants to merge 2 commits into
masterfrom
bugfix/remove-hidden-text

Conversation

@lfoppiano

Copy link
Copy Markdown
Collaborator

TBA

Detect text painted with render mode 3 or 7, or near-zero opacity, as invisible (previously only render mode 3). Always emit INVISIBLE="true" on such tokens so consumers can filter hidden text (white-on-white is already exposed via FONTCOLOR).

Add -removeHiddenText: drop hidden tokens (invisible or white) that are not positioned over a page image, while keeping genuine OCR text layers (text over an image). Addresses GROBID issues #826 and #1083.
Capture the per-glyph fill/stroke constant opacity (already computed but previously discarded) and emit OPACITY="<value>" on <String> tokens that are not fully opaque, keeping FONTCOLOR as standard #RRGGBB. Fully transparent text (opacity 0) is still reported via INVISIBLE. Addresses pdfalto issue #82.

Also complete the render-mode-7 invisibility check in drawChar; the earlier change had only covered the drawString path.
@lfoppiano lfoppiano added this to the 0.7.0 milestone Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant