Skip to content

[Bug]: Searching (CTRL+F) does not respect spaces, and shows incorrect results #20225

@imad-meghelli

Description

@imad-meghelli

Attach (recommended) or Link to PDF file

Morse.pdf

Web browser and its version

Mozilla Firefox 142.0

Operating system and its version

Windows 10

PDF.js version

5.4.149

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

Yes

Is a browser extension

No

Steps to reproduce the problem

Open the PDF in Firefox, search with CTRL+F. As my only example throughout this issue, the search term will be "...." (four dots).

What is the expected behavior?

I have tested the file with other PDF readers, such as Adobe Acrobat, and in Microsoft Edge (which uses Adobe Acrobat too), and it works as intended, it only shows results with 4 dots, and doesn't add any arbitrary spaces.

Image

What went wrong?

It shows incorrect results. It should only display results for "...." (four dots), but it includes results with arbitrary spaces thrown in, such as ". ..." (dot space 3dots), ".. .." (2dots space 2dots).

Image

Link to a viewer

No response

Additional context

FWIW, I have also tested SumatraPDF reader, and it has the same exact problem (same results) as Firefox, I don't know how related they are.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions