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

Add a moving overlay magnifier #13287

Open
yecril71pl opened this issue Apr 23, 2021 · 4 comments
Open

Add a moving overlay magnifier #13287

yecril71pl opened this issue Apr 23, 2021 · 4 comments

Comments

@yecril71pl
Copy link

Attach (recommended) or Link to PDF file here: ROZPORZĄDZENIE MINISTRA CYFRYZACJI

Configuration:

  • Web browser and its version: Firefox Release 87.0
  • Operating system and its version: openSUSE Tumbleweed [20210420]
  • PDF.js version:
  • Is a browser extension: no

Steps to reproduce the problem:

  1. Tell the reader to use a moving magnifier.

What is the expected behavior? (add screenshot)
The magnifier should magnify a rectangular area around the pointer in an overlay.
magover

What went wrong? (add screenshot)
There is no such tool.
tools

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 23, 2021

The magnifier should magnify a rectangular area around the pointer in an overlay.

Something like that, besides being an edge-case with a disproportionate implementation/maintenance overhead, would result in somewhat unsatisfactory performance overall given that it would lead to rendering starting/stopping a lot when in use. (Thus tying up resources better spend on pre-rendering actual pages.)
Please note that since the PDF.js library renders onto <canvas> elements, we cannot simply magnify an existing page but would need to actually render a partial page instead. (Otherwise the result would in many/most cases look blurry.)


I'd suggest WONTFIX here, for the reasons listed above; and (essentially) duping this to issue #1260 which is somewhat related.

@yecril71pl
Copy link
Author

The magnifier should magnify a rectangular area around the pointer in an overlay.

Something like that, besides being an edge-case with a disproportionate implementation/maintenance overhead, would result in somewhat unsatisfactory performance overall given that it would lead to rendering starting/stopping a lot when in use. (Thus tying up resources better spend on pre-rendering actual pages.)

I am not sure how you judge "disproportionate" and "better spent" but being able to actually read a page detail would be a huge bonus. I am afraid your evaluation is influenced by the fitness of your eyesight.

Please note that since the PDF.js library renders onto <canvas> elements, we cannot simply magnify an existing page but would need to actually render a partial page instead. (Otherwise the result would in many/most cases look blurry.)

That is what PSView and xdvi do. The page should be rendered in the background onto a canvas of a higher resolution and project a view of that bitmap onto the overlay.

I'd suggest WONTFIX here, for the reasons listed above; and (essentially) duping this to issue #1260 which is somewhat related.

This one is more dynamic because you can scroll.

@Snuffleupagus
Copy link
Collaborator

The page should be rendered in the background onto a canvas of a higher resolution and project a view of that bitmap onto the overlay.

Rendering all pages at e.g. double their actual size, just to support an edge-case, would affect both overall performance and memory usage negatively; hence why this wouldn't really be a good idea.

Please also note that it's already possible to zoom-in/out around the current cursor position, by using "normal" zooming with:
Ctrl+mouse wheel

@yecril71pl
Copy link
Author

yecril71pl commented Apr 23, 2021

The page should be rendered in the background onto a canvas of a higher resolution and project a view of that bitmap onto the overlay.

Rendering all pages at e.g. double their actual size, just to support an edge-case, would affect both overall performance and memory usage negatively; hence why this wouldn't really be a good idea.

Double rendering would be required only when the magnifier tool is active.

Please also note that it's already possible to zoom-in/out around the current cursor position, by using "normal" zooming with:
Ctrl+mouse wheel

This affects the whole page rather than the nearest neighbourhood and interferes with scrolling. While you can scroll with the hand tool, you see less of the page when the whole page is zoomed. Moreover, the hand tool requires you to press the button, which is a nuisance (I know you can press the middle button once but it works under Microsoft Windows only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants