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

Use full screen width in presentation mode #4524

Merged

Conversation

fkaelberer
Copy link
Contributor

Fixes #4439 by removing all horizontal borders and reducing the vertical ones when in presentation mode.
This improves reading on small devices.

It still looks a little bit awkward that the document is tied to the top of the screen on portrait mode displays, but I didn't figure out how to correctly center it.

@Snuffleupagus
Copy link
Collaborator

/botio-windows preview

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/f4449dbbc16c8c5/output.txt

@fkaelberer
Copy link
Contributor Author

By the way: Is it correct that SCROLLBAR_PADDING is used in
https://github.com/mozilla/pdf.js/blob/master/web/page_view.js#L392?
The code in https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L288, seems to perform similar calculations, but uses VERTICAL_PADDING instead.
I was just wondering, so ignore this comment if everything is correct.

@Snuffleupagus
Copy link
Collaborator

There seems to be an issue with the previous zoom level not getting set correctly with this patch, when exiting presentation while viewing a file with varying page sizes.

A file to reproduce the issue with: http://www.pdfsharp.net/wiki/%28S%28gxgrd055sfetvh55lp5jya55%29%29/GetFile.aspx?File=%2FPageSizes-sample%2FPageSizes_output.pdf.

@fkaelberer
Copy link
Contributor Author

Can you be more precise on the steps to reproduce?

Some problems were there already, so I don't know if my patch is the cause.

  1. Open http://www.pdfsharp.net/wiki/%28S%28gxgrd055sfetvh55lp5jya55%29%29/GetFile.aspx?File=%2FPageSizes-sample%2FPageSizes_output.pdf#page=18
    Result: Page 36 is shown (B5 landscape)
  2. Now zoom out using the - mouse button or Ctrl+-.
    Result: Page 17 is shown (RA2), pages are not horizontally centered, but ragged right.

@fkaelberer
Copy link
Contributor Author

Another issue:
0. Open Firefox and maximize Windows size.

  1. Open http://www.pdfsharp.net/wiki/%28S%28gxgrd055sfetvh55lp5jya55%29%29/GetFile.aspx?File=%2FPageSizes-sample%2FPageSizes_output.pdf&AspxAutoDetectCookieSupport=1#page=20&zoom=2
    Result: There seems to be a refresh loop and the spin wheel keeps appearing and disappearing on all pages. Constant CPU load.
    If the problem does not appear, try scrolling to a different part of the document.
  2. Reduce the Firefox window size to half-screen height.
    Result: Rendering finishes normally.

The issue appears also in Chrome.

@Snuffleupagus
Copy link
Collaborator

Can you be more precise on the steps to reproduce?

The issue I described should by fixed if you make the following changes:

diff --git a/web/presentation_mode.js b/web/presentation_mode.js
index d7c5d29..6a233d3 100644
--- a/web/presentation_mode.js
+++ b/web/presentation_mode.js
@@ -143,6 +143,7 @@ var PresentationMode = {
   },

   exit: function presentationModeExit() {
+    this.active = false;
     var page = PDFView.page;

     // Ensure that the correct page is scrolled into view when exiting
@@ -151,9 +152,6 @@ var PresentationMode = {
     setTimeout(function exitPresentationModeTimeout() {
       PDFView.setScale(this.args.previousScale);
       PDFView.page = page;
-      // Keep Presentation Mode active until the page is scrolled into view,
-      // to prevent issues in non-Mozilla browsers.
-      this.active = false;
       this.args = null;
     }.bind(this), 0);

I think that change should be OK, given that PR #4292 restored the old (properly working) behaviour.

Result: Page 36 is shown (B5 landscape)
2. Now zoom out using the - mouse button or Ctrl+-.
Result: Page 17 is shown (RA2)

This sounds like a duplicate of #3949, and is caused by the fact that the pages all have very different sizes.

pages are not horizontally centered, but ragged right.

Sounds like a duplicate of #4186, patch has been submitted in #4188.

Another issue:
0. Open Firefox and maximize Windows size.
...

Probably not related to this issue, so I wouldn't worry about that here.
Also, zoom == 2, that's a very tiny zoom value.

@fkaelberer
Copy link
Contributor Author

Thank you for the suggestions.

@fkaelberer
Copy link
Contributor Author

After thinking about this some more, it might be better to move this line down

Done. Thank you for thinking.

@yurydelendik
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Apr 2, 2014

From: Bot.io (Linux)


Received

Command cmd_preview from @yurydelendik received. Current queue size: 0

Live output at: http://107.21.233.14:8877/3797b4e182e5fa7/output.txt

yurydelendik added a commit that referenced this pull request Apr 2, 2014
Use full screen width in presentation mode
@yurydelendik yurydelendik merged commit 75d09fd into mozilla:master Apr 2, 2014
@yurydelendik
Copy link
Contributor

Thank you

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

Successfully merging this pull request may close these issues.

Documents do not use whole screen in presentation mode
4 participants