Skip to content

[Bug]: Call onSetModified is not called in some cases #19966

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

Open
jcalfee opened this issue May 21, 2025 · 0 comments
Open

[Bug]: Call onSetModified is not called in some cases #19966

jcalfee opened this issue May 21, 2025 · 0 comments
Labels

Comments

@jcalfee
Copy link

jcalfee commented May 21, 2025

Attach (recommended) or Link to PDF file

When images or text are inserted onSetModified is called just fine. However, after calling annotationStorage.resetModified() then moving these object around, onSetModified is not called again. If this were a real save, there appears to be no way to detect that the document was modified again after the save if only images have been moved.

Also, under Draw, onSetModified is only called after the "Draw" dropdown is hidden (by clicking on its icon a second time). It should work like Highlight and call onSetModified on mouse key up.

Great editor though! Very impressive.

Web browser and its version

chromium 132

Operating system and its version

pop-os

PDF.js version

Latest from your website https://mozilla.github.io/pdf.js/web/viewer.html

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

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. add onSetModified listener that logs a message then calls pdfDocument.annotationStorage.resetModified()
  2. Insert image and observe the log message was called
  3. Move the image and observe that when the mouse is relased, the onSetModified is not called

The immediate call to resetModified is just a fast way of mimicking save..

What is the expected behavior?

Always able to trap unsaved changes.

What went wrong?

Did not always trap unsaved changes.

Link to a viewer

https://mozilla.github.io/pdf.js/web/viewer.html

Additional context

No response

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