Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PageTextContent filtering functionality #160

Closed
apla opened this issue Feb 27, 2018 · 2 comments
Closed

PageTextContent filtering functionality #160

apla opened this issue Feb 27, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@apla
Copy link

apla commented Feb 27, 2018

Hi, I would like to add filtering functionality to the Page's TextContent. When onGetTextSuccess returns modified data, this data will be used for the text content of page.

It is will be really useful for badly exported PDF with text columns. For example, if pdf contains page with two columns, but text misplaced and PDF Text Contents have structure like

[
{col:1, row:1}, 
{col:2, row:1}, 
{col:1, row:2}, 
{col:2, row:2}, 
]

or another weird cases (try to select text from Device Information to the table contents from this PDF). I can detect those cases programmatically and correct them.

Another case is for rendering texts such as I²C or H2O

If you're ok with those additions I will submit pull request.

@wojtekmaj
Copy link
Owner

Hmmm. I have nothing against it, but I wonder how it would look like. Would you share some potential implementation for me to get the idea on what you're trying to achieve?

@wojtekmaj
Copy link
Owner

Hey @apla,
As of v3.0.0, react-pdf supports custom text rendering. You are given as much data as I have myself about text items to render. Sadly, there's no such thing as row/column in PDFs, only x and y positions, but I'd love to hear what you think!

@wojtekmaj wojtekmaj self-assigned this Mar 18, 2018
@wojtekmaj wojtekmaj added the enhancement New feature or request label Mar 18, 2018
@wojtekmaj wojtekmaj added this to the 3.0.0 milestone Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants