You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initialize pdfjs viewer with a pdf that was given in the attachment (for easier reproduction you can even use the demo example because I found the same thing happening there as well - https://mozilla.github.io/pdf.js/web/viewer.html)
Dispatch the 'updateviewarea' event to the event bus: PDFViewerApplication.eventBus.dispatch('updateviewarea', { source: PDFViewerApplication.pdfViewer, location: { pageNumber: 1, scale: 150, top: 374, left: -174, rotation: 0, pdfOpenParams: '#page=1&zoom=150,-174,374' } });
What is the expected behavior?
The view area changes to the given coordinates.
What went wrong?
The view area stays the same.
Link to a viewer
No response
Additional context
With everything described, the view area DOES change but only when refreshing the browser. I am doing the dispatching via a button click. Should I do anything else in combination with 'updateviewarea'. I tried reloading the document but that just resets the 'location' data so I achieved nothing, I tried using the 'update()' method from the pdfViewer, again the same thing - nothing.
This discussion was converted from issue #18827 on October 01, 2024 07:52.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Attach (recommended) or Link to PDF file
compressed.tracemonkey-pldi-09.pdf
Web browser and its version
Firefox 130.0.1 (64-bit)
Operating system and its version
Ubuntu 24.04.1
PDF.js version
4.6.82
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
PDFViewerApplication.eventBus.dispatch('updateviewarea', { source: PDFViewerApplication.pdfViewer, location: { pageNumber: 1, scale: 150, top: 374, left: -174, rotation: 0, pdfOpenParams: '#page=1&zoom=150,-174,374' } });What is the expected behavior?
The view area changes to the given coordinates.

What went wrong?
The view area stays the same.

Link to a viewer
No response
Additional context
With everything described, the view area DOES change but only when refreshing the browser. I am doing the dispatching via a button click. Should I do anything else in combination with 'updateviewarea'. I tried reloading the document but that just resets the 'location' data so I achieved nothing, I tried using the 'update()' method from the pdfViewer, again the same thing - nothing.
Beta Was this translation helpful? Give feedback.
All reactions