Giter Club home page Giter Club logo

Comments (7)

agentcooper avatar agentcooper commented on June 14, 2024

This is a known limitation. Because PDF.js uses absolute positioning, the chunks of text are sometimes merged. What can be done: the code which gets the text from the range can be improved to take the rectangle positions into the account https://github.com/agentcooper/react-pdf-highlighter/blob/master/src/components/PdfHighlighter.js#L485.

from react-pdf-highlighter.

SelvaSurukam avatar SelvaSurukam commented on June 14, 2024

Hi thanks for quick reply.

When I tried to open PDF and copy text with Google Chrome Default PDf viewer, I am not getting this issue.

As you said earlier the problem in PDF.js, do you have some work around code samples to solve this or do you aware of how Google Chrome able to solve this.

from react-pdf-highlighter.

agentcooper avatar agentcooper commented on June 14, 2024

Chrome's built-in viewer is not PDF.JS, they use a custom PDF renderer: https://opensource.google.com/projects/pdfium.

from react-pdf-highlighter.

SelvaSurukam avatar SelvaSurukam commented on June 14, 2024

Hi once again thanks for quick reply.

Do you have any sample to fix this issue? Because you aware of this and you might have tried some approach to solve this.

If you have anything please share it, I can continue from there, because I have to fix this issue on priority now.

from react-pdf-highlighter.

agentcooper avatar agentcooper commented on June 14, 2024

I don't have anything working, sorry. As I said earlier, I would start with exploring the distance between the rectangles.

from react-pdf-highlighter.

SelvaSurukam avatar SelvaSurukam commented on June 14, 2024

Thanks, will implement and get back to you.

from react-pdf-highlighter.

shalinivasudev avatar shalinivasudev commented on June 14, 2024

Did this problem get solved @SelvaSurukam ?

from react-pdf-highlighter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.