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

ebook reader: page not scroll to top after leaf through (prev or next) #73

Closed
UnnamedHero opened this issue Jan 22, 2018 · 5 comments
Closed

Comments

@UnnamedHero
Copy link

It is very annoying to scroll to the top of a page every time after swithing to next or prevoius page.

@Yetangitu
Copy link
Owner

Reader is designed for reading full pages, without scrolling. In what context do you have to scroll the page up after turning a page. Also, which renderer (Epub, PDF, CBx) does this apply to?

@UnnamedHero
Copy link
Author

This applies to pdf renderer. A PDF page renders with a tiny font in fit-to-screen mode. It is very uncomfortable to read even on 24" monitor @ 1920x1080.

@Yetangitu
Copy link
Owner

Try the following patch:

diff --git a/files_reader/vendor/pdfjs/pdf.reader.js b/files_reader/vendor/pdfjs/pdf.reader.js
index 510d3d7..b5bc3ec 100644
--- a/files_reader/vendor/pdfjs/pdf.reader.js
+++ b/files_reader/vendor/pdfjs/pdf.reader.js
@@ -752,6 +752,7 @@ PDFJS.Reader.prototype.renderPage = function(pageNum) {
             renderTask.promise.then(
                 function pdfPageRenderCallback (something) {
                     if (reader.cancelPage[pageNum] === undefined) { 
+                        document.getElementById('viewer').scrollTo(0,0);
                         if (double_buffer)
                             ctx.drawImage(oscanvas, 0, 0);
                         if (textLayer)

@Yetangitu
Copy link
Owner

Yetangitu commented Jan 22, 2018

BTW, the following screen dump shows Reader with a double-page spread at 1920*1200. Quite readable I'd say, especially at 24". Make sure to use the full screen function to use the maximum amount of screen real estate.

image

@Yetangitu
Copy link
Owner

This will be an option in the next release:

image

The option will be disabled by default.

Yetangitu added a commit that referenced this issue Jan 31, 2018
change (#73), default viewer selection in personal preferences section (#74), fixed undefined $title in template (#72)
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

No branches or pull requests

2 participants