Skip to content

Text Selection Layer is misaligned with content #2064

@thekevinbrown

Description

@thekevinbrown

Before you start - checklist

  • I followed instructions in documentation written for my React-PDF version
  • I have checked if this bug is not already reported
  • I have checked if an issue is not listed in Known issues
  • If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo

Description

I'm observing the text selection layer becoming misaligned with the content for a specific kind of PDF. When I load it in PDF.js and select the text I get this:

Image

But when I do it in React PDF, I get this:

Image

I can't share the PDF file here, what can I do to help debug?

Steps to reproduce

  1. Load PDF into viewer.
  2. Select text

Expected behavior

Text selection layer is aligned with content.

Actual behavior

Text selection layer does not align with content.

Additional information

No response

Environment

  • Browser (if applicable): Chrome, Firefox, Zen, Edge.
  • React-PDF version: 10.3.0
  • React version: 19.2.3
  • Bundler name and version (if applicable): Vite npm:rolldown-vite@7.1.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions