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]: Annotation artifacts remain visible in viewer after deleting all annotations. #18915

Open
atrinker opened this issue Oct 17, 2024 · 2 comments

Comments

@atrinker
Copy link

Attach (recommended) or Link to PDF file

test.pdf

Web browser and its version

Mozilla Firefox

Operating system and its version

Windows 10

PDF.js version

4.7.76

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

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Open the attached PDF in the default viewer.
  2. Activate the annotation editor by clicking highlight on the toolbar.
  3. Scroll down to the following pages to load the annotations.
  4. Press Ctrl+A to select all annotations in the PDF.
  5. Press delete to remove all annotations at once.

What is the expected behavior?

All annotations should be removed from the PDF.

What went wrong?

Although the annotations are no longer selectable, some of them still appear visible in the viewer. They only disappear once the annotation editor is closed.

Link to a viewer

No response

Additional context

No response

@calixteman
Copy link
Contributor

This is a tricky bug...
When the pdf is rendered we only render the 2 (it depends of the zoom level) first pages, so we're only aware of the annotations we have on those pages. That means we don't have the ids, the properties, ... of the other annotations in the pdf.
For example, we can ctrl+a and then change the color of one highlight, it should impact all the highlights of the document.
So I think the only right way to fix this would be to get all the editable annotations when the user is selecting all, put them in the storage, and then apply the changes to the data we've in the storage.

@zzadxz
Copy link

zzadxz commented Nov 22, 2024

The problem is most likely OS related. I played around with it on macOS Firefox latest version (132.0.2 aarch64) and Chrome (131.0.6778.70). PDF.js correctly identified and rendered all highlighted text, regardless of the zoom level (even on "Page Fit", all highlights were selected and removed after backspacing or clicking on the delete button).

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