Attach (recommended) or Link to PDF file
https://github.com/mozilla/pdf.js/blob/master/test/pdfs/highlight_popup.pdf (from the PDF.js test corpus)
Web browser and its version
Chromium 153
Operating system and its version
macOS 26.5
PDF.js version
6.4.299
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
- Enable comments (
enableComment: true) and open highlight_popup.pdf (a Highlight 24R with its Popup 25R).
- Click the comment button of the highlight, then "Edit comment", change the text and save the comment.
- Save (download) the document. Repeat steps 2–3 with the saved file a few times.
What is the expected behavior?
The highlight's existing Popup is reused (or replaced), so the page keeps one Popup for the comment.
What went wrong?
Every edit adds a new Popup annotation without /Rect to the page and points the highlight's /Popup to it; the previous Popups stay in /Annots. page.getAnnotations() of the saved files:
original 24R Highlight (popupRef 25R), 25R Popup
after edit 1 24R Highlight (popupRef 32R), 25R Popup, 32R Popup (no /Rect)
after edit 2 24R Highlight (popupRef 34R), 25R Popup, 32R Popup (no /Rect), 34R Popup (no /Rect)
after edit 3 24R Highlight (popupRef 36R), 25R Popup, 32R Popup (no /Rect), 34R Popup (no /Rect), 36R Popup (no /Rect)
/Rect is required for annotations, so stricter readers may complain, and the orphaned Popups pile up with every edit. The UI still shows a single comment.
Link to a viewer
No response
Additional context
No response
Attach (recommended) or Link to PDF file
https://github.com/mozilla/pdf.js/blob/master/test/pdfs/highlight_popup.pdf (from the PDF.js test corpus)
Web browser and its version
Chromium 153
Operating system and its version
macOS 26.5
PDF.js version
6.4.299
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
enableComment: true) and openhighlight_popup.pdf(a Highlight24Rwith its Popup25R).What is the expected behavior?
The highlight's existing Popup is reused (or replaced), so the page keeps one Popup for the comment.
What went wrong?
Every edit adds a new Popup annotation without
/Rectto the page and points the highlight's/Popupto it; the previous Popups stay in/Annots.page.getAnnotations()of the saved files:/Rectis required for annotations, so stricter readers may complain, and the orphaned Popups pile up with every edit. The UI still shows a single comment.Link to a viewer
No response
Additional context
No response