Repository navigation
Viewer: zoom a document's pages or an image without zooming the window - #737
Merged
Merged
Conversation
A PDF's or Office file's pages, and an image, zoom from 25% to 400% of the pane's width: + and - in the viewer's header (the percentage between them fits the pane again), Ctrl or Cmd with the wheel, a trackpad pinch (wheel events with Ctrl in Chromium, gesture events in Safari and the macOS window), or +, - and 0 with the document focused. Only the document grows; its pane scrolls across, the Library pane scrolls down, and the window's own zoom keys stay the window's. A wheel or pinch keeps the spot under the pointer in place; the buttons zoom about the middle of the view. Each file keeps its zoom while the Studio is open. Pages zoomed in are drawn again once the zoom holds still. pdf.js draws the page off screen at the new width, up to 16 million pixels, and copies it in. The server's page images take dpi= (200, 300 or 400 besides the 130 they are drawn at), each cached in its own folder, and the viewer asks for the resolution the width needs on the screen; a finer image replaces the shown one once it has loaded, and is kept for the file. The file's tab row now stays under the header at the header's measured height: in a narrow pane the header wraps to two lines, and the fixed offset left the tabs under it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A PDF's or Office file's pages, and an image, can now be zoomed in the viewer without zooming the whole Studio. Zooming the window to read a page made the rest of the layout too large.
Zoom
Sharp pages
GET /api/kb/pdf-pagetakesdpi=and rounds it up to 200, 300 or 400 (130 stays the default). Each resolution is cached in its own folder with its own ETag. Zoomed past 100%, the viewer asks for the resolution the page's width needs on the screen. A finer image replaces the one on screen only after it has loaded, and is kept for that file, so zooming back out makes no new request.Also
The file's tab row now stays under the header at the header's measured height. In a narrow pane the header wraps to two lines, and the fixed 49px offset had left the tabs under it.
Checked
PageDPIrounding; pages drawn at 130, 300 and 400 dpi (1105, 2550 and 3400 pixels wide for a letter page), each in its own cache file.HELP.md, REFERENCE.md and README are updated.