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

[Bug]: "Find" doesn't match text in popup annotations #18591

Open
garydeng01 opened this issue Aug 9, 2024 · 3 comments
Open

[Bug]: "Find" doesn't match text in popup annotations #18591

garydeng01 opened this issue Aug 9, 2024 · 3 comments

Comments

@garydeng01
Copy link

Attach (recommended) or Link to PDF file

popup_example.pdf

Web browser and its version

Chrome 124.0.6367.92

Operating system and its version

Windows 10 Enterprise 22H2

PDF.js version

v4.5.136

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

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Get the PDF.JS code
  2. Replace "web/compressed.tracemonkey-pldi-09.pdf" with "popup_example.pdf"
  3. Build the project and launch the local server
  4. Navigate to the local URL
  5. Click the yellow popup annotation in order to expand it
  6. Click within the pdf viewer to make sure it's active
  7. Press Ctrl-F to bring up the search text box
  8. Type in "seashells"
  9. Observe that the find module reports "phrase not found"
  10. Click within the address bar of the browser
  11. Press Ctrl-F to bring up the browser's search text box
  12. Type in "seashells"
  13. Observe that one of the search match results is the text within the expanded popup annotation

What is the expected behavior?

PDF.JS's search module finds the matching "seashells" phrase in the expanded popup annotation.

What went wrong?

PDF.JS's search module does not find the matching "seashells" phrase in the expanded popup annotation.
image

Link to a viewer

No response

Additional context

No response

@garydeng01 garydeng01 changed the title [Bug]: "Find" doesn't detect text matches in popup annotations [Bug]: "Find" doesn't match text in popup annotations Aug 9, 2024
@nicolo-ribaudo
Copy link
Contributor

Do you expect it to search also in annotations that are not open (those that only open when you pass the mouse on them), or in all of them?

This seems interesting and if the maintainers like the feature I will probably submit a PR at some point, but maybe it should be opt-in through a checkbox in the search bar,

@Snuffleupagus
Copy link
Collaborator

Do other PDF Viewers even support something like this, since this really does seem like something that could add a whole bunch of additional complexity to the find implementation!?

@garydeng01
Copy link
Author

garydeng01 commented Aug 13, 2024

Do you expect it to search also in annotations that are not open (those that only open when you pass the mouse on them), or in all of them?

This seems interesting and if the maintainers like the feature I will probably submit a PR at some point, but maybe it should be opt-in through a checkbox in the search bar,

For my use case, I would prefer that the search includes the popup annotations that are not open. Perhaps navigating to such a match would then open the popup and highlight the text within? I'm not sure what most users would prefer, but this seems like a reasonable way for it to function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants