Skip to content

[Bug]: Some style rules cause textlayer to display incorrectly #20051

Open
@chenglu4343

Description

@chenglu4343

Attach (recommended) or Link to PDF file

pdfFile:https://github.com/mozilla/pdf.js/blob/master/web/compressed.tracemonkey-pldi-09.pdf
Repository Address:https://github.com/chenglu4343/pdf.js/tree/bug-style

Web browser and its version

Chrome 137.0.7151.122

Operating system and its version

windows11

PDF.js version

5.3.31

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Clone repository:https://github.com/chenglu4343/pdf.js/tree/bug-style
  2. run
npm install 
npx gulp server
  1. open http://localhost:8888/web/viewer.html?file=%2Fweb%2Fcompressed.tracemonkey-pldi-09.pdf , and select the text

or

Add the following styles before using the viewer.

<style>
  body > div {
    height: 100%;
  }
 </style>

What is the expected behavior?

The textlayer can be displayed normally.

What went wrong?

Image

textLayer display error

Link to a viewer

No response

Additional context

I'm not sure what happened. Can it be fixed, or can you clarify the hidden usage rules of the viewer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions