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]: Adding Image leads to error if already image annotation exists in loaded PDF #19310

Closed
Mario185 opened this issue Jan 9, 2025 · 1 comment

Comments

@Mario185
Copy link

Mario185 commented Jan 9, 2025

Attach (recommended) or Link to PDF file

example.pdf

Web browser and its version

Firefox 133

Operating system and its version

Windows 10

PDF.js version

4.10.38

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

Yes

Is a browser extension

No

Steps to reproduce the problem

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

  2. Open the attachted example.pdf file

  3. Make sure Page 1 is visible

  4. Scroll to Page 2, make sure Page 1 is not visible anymore

  5. Click on "Add or Edit image" (In the console is an error logged)
    image

  6. Adding an image does not work

What is the expected behavior?

Adding an image works

What went wrong?

Uncaught (in promise) TypeError: canvas is null
getFromCanvas tools.js:223
deserialize stamp.js:764
deserialize annotation_editor_layer.js:649
enable annotation_editor_layer.js:262
#enableAll tools.js:1816
updateMode tools.js:1688
updater pdf_viewer.js:2346
set annotationEditorMode pdf_viewer.js:2393
bindEvents app.js:1940
dispatch event_utils.js:115
bindListeners toolbar.js:194
#bindListeners toolbar.js:192
Toolbar toolbar.js:123
_initializeViewerComponents app.js:594
initialize app.js:257
run app.js:688
webViewerLoad viewer.js:261
viewer.js:272
tools.js:223:42
updateMode tools.js:1688
AsyncFunctionThrow self-hosted:804
(Async: async)
updater pdf_viewer.js:2346
set annotationEditorMode pdf_viewer.js:2393
bindEvents app.js:1940
dispatch event_utils.js:115
bindListeners toolbar.js:194
(Async: EventListener.handleEvent)
#bindListeners toolbar.js:192
Toolbar toolbar.js:123
_initializeViewerComponents app.js:594
initialize app.js:257
InterpretGeneratorResume self-hosted:1413
AsyncFunctionNext self-hosted:800
(Async: async)
run app.js:688
webViewerLoad viewer.js:261
viewer.js:272

Link to a viewer

No response

Additional context

No response

@Snuffleupagus
Copy link
Collaborator

Duplicate of #19239

@Snuffleupagus Snuffleupagus marked this as a duplicate of #19239 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants