question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Zoom parameter implemented "upside-down"

See original GitHub issue

According to the open parameter specification, link, the zoom parameter should be implemented as: zoom=scale,left,top, with the interpretation:

Scroll values left and top are in a coordinate system where 0,0 represents the top left corner of the visible page, regardless of document rotation.

This is not the case in pdf.js, which is a problem if you try opening the following: http://mozilla.github.io/pdf.js/web/viewer.html#page=2&zoom=auto,0,0

  • Expected result: The document should open at the top of page 2, as it does with Adobe Reader.
  • What actually happens: The document is scrolled down to the top of page 3.

The problem seems to be that in pdf.js the origin in the coordinate system (the one that is exposed to the user) is placed at the bottom left corner. From what I’ve gathered, pdf.js internally uses a coordinate system placed at the top left corner of the page, so I don’t know why it’s not working. I’m not that familiar with this part of the codebase, but could the issue be here: https://github.com/mozilla/pdf.js/blob/master/src/util.js#L390

This issue might be related to issues involving links pointing to the wrong place in PDFs, e.g. #2814, #2401, #2151, since all those files contains links that also applies a rescaling to “page-fit”. I’m guessing that what happens is that the zoom is set to zoom=page-fit,0,0, which clearly isn’t working.

Issue Analytics

  • State:open
  • Created 11 years ago
  • Reactions:1
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
markmatneycommented, Apr 28, 2019

I’ve been looking into this issue a bit, and I agree with @Snuffleupagus 's comment. Currently, PDF JS interprets the zoom parameter value of PDF URL fragments according to the definition of the “user space” coordinate system in the PDF Reference (1.7):

The positive x axis extends horizontally to the right and the positive y axis vertically upward, as in standard mathematical practice (subject to alteration by the Rotate entry in the page dictionary).

It should instead be using the coordinate system defined by the open parameters document:

Scroll values left and top are in a coordinate system where 0,0 represents the top left corner of the visible page, regardless of document rotation.

Before the code in web/pdf_link_service.js calls BaseViewer.scrollPageIntoView, there should be a transformation from the “open parameters” coordinate system to the “user space” coordinate system.

0reactions
jraygauthiercommented, Aug 18, 2017

The top of the page of the spec for the zoom parameter by adobe (for pdf.js users)

For any other users, the preceding will show the bottom of the page.

The top of the page of the spec for the zoom parameter by adobe (for any other users: chrome, explorer or acrobat)

For pdf.js users, the preceding will show the bottom of the page.

Note that both cases won’t reach the same bottom which would mean that there is an issue with the scale of the vertical component of the coordinate system as well…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manually rotating video - Zoom Support
If your camera is displaying upside-down or sideways in the Zoom desktop client, you can rotate the camera in your settings until it...
Read more >
How to specify parameters to google chrome adobe pdf viewer?
At the time of this answer there is no way to pass parameters (like zoom) to the ... view : implemented (accepts Fit...
Read more >
Why Am I Upside Down in Zoom? How to Fix - Tech Junkie
Rotate Your Camera Before Zoom Meeting ... The upside-down camera issue most frequently occurs when you Zoom in a desktop client or browser....
Read more >
OBSBOT Tiny User Manual
Upside Down Mode ... OBSBOT Tiny has the first of the kind implementation of gesture ... Users can do the manual control for...
Read more >
PEARL / Zoom-Office Training Guide and User Manual for ...
NOTE: For better performance, select any Application voice you wish and then match it with the same computer System Voice. You can change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found