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 · 1 comment
Labels

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.

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

No branches or pull requests

2 participants