Skip to content

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

Open
@jcalfee

Description

@jcalfee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions