-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Implement a Two Page View Mode #3723
Conversation
Compared to the previous PRs, this implementation of the Two Page View Mode differs slightly. |
I think that now that the items are in a menu with separators, you can change "Show Cover Page in Two Page View" to simply "Show Cover Page". It'll be less redundant. Other than that, nice job! |
@waddlesplash Thanks for the feedback! |
@Snuffleupagus Two things:
The functionality in this PR is really nice. I'll have to take a closer look at the code, but it appears to be working really good. I'll also take a shot at making some descriptive icons. |
@timvandermeij Regarding your comments:
|
@Snuffleupagus I see, Adobe Reader does it too. Strange choice of words in my opinion, but okay then :) I agree with @waddlesplash that 'Show Cover Page' would be good enough as it is really just an extension of the two page view option and not a separate option. |
I have added some review comments. I think what remains for this PR is:
|
No it doesn't need but I suggest using a language independent icon for cover icon as not all languages are using Arabic digits (1234...), something like a simplistic nature view http://openclipart.org/people/Machovka/Machovka_cloudy.svg or something more applicable |
The review comments have been addressed and the l10n strings are changed slightly. The last commit also contains a change that prevents issues, if the user tries to change the page mode before the document has begun to load. /botio-linux preview |
I found the comment from @ebraminio very useful and decided to design another icon for the 'show cover' functionality. Take a look at the new icon below. It no longer contains a digit or other language-specific items, it's literally what I could think of as a cover page: a big title on top and lines of text below it. I have tested it for this PR using @Snuffleupagus What do you think of this new icon? If you like it, could you add it to the PR? |
@timvandermeij I don't dislike it. ;-) @pjaytycy I'm not exactly sure if you meant including all of your illustration as an icon, or just the top "page"!? |
@Snuffleupagus I was inspired by the Tracemonkey PDF, but perhaps that's not the best example of a real cover page. I can try adding a simplistic image (barely noticable because of the 16x16 format, but still...) later and see if that works out better. |
What about a title (like you already did) and then just a square, suggesting an "image", below it? |
@Snuffleupagus Could you fix the merge conflicts? Also, is something still blocking this patch? |
Yes, the fact that I've been unable to get the toggling of page mode working as it should from the context menu in Presentation Mode. At this point, I leaning towards just scrapping this part of the patch. That would of course mean that the only way to change page mode is from the Secondary Toolbar, before entering Presentation Mode. |
Yes. It's useful. |
@Snuffleupagus what else needs to be done here? |
@waddlesplash I don't think that there is much else, so reviewing I guess. |
Awesome. I say it's ready to be merged, but I'm not a reviewer 😄 |
Let's get this PR rolling again. It seems like a really useful feature to me and I think it's practically ready. @Snuffleupagus: Could you resolve the merge conflicts? |
I would like the functionality of PR #3967 to land first, to be able to add code to scroll pages into view properly (horizontally) in two page view mode. |
@Snuffleupagus Could you rebase this? Also, is there anything that needs to be done for this PR according to you? If not, we should review this. |
I don't believe there is. I've made a number of small improvements compared to the first version, but at this point I don't think that I can do much more. /botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/902365025dcf953/output.txt |
Is there still a plan to add two-pages display? It's quite an important feature of a PDF viewer IMO, and content which was meant to be displayed as two-pages, like magazines, really suffers if it can't. |
The PR is now open for over 600 days. What is holding it back? |
The main problem is that pages can be of different sizes and that the current implementation might not deal with that properly. There is also the problem of testing this: it has to be done manually as there are no browser tests for this yet. |
Is there a document that explains how to implement the changes from @Snuffleupagus (a few posts above this) in the latest release of pdf.js ? |
@micsan13br You would have to clone the branch and rebase it onto the current master branch. After that you should be able to work with it using |
I've tried to rebase the changes from @Snuffleupagus but the changes are complexer then I thought. Maybe someone can help here? |
I'd be more comfortable with landing this feature with more tests. In the mean time I'll close it until we have done something about #6505. |
TBH this doesn't sound like a great reason to close this PR. Admittedly the patch is very bitrotted, but it's probably the place where most discussions of this feature happened, and closing it would hide this discussion (e.g. while searching within open issues). |
Discussions about the issue should take place in #590. Discussions here should only concern this particular implementation. Since this patch is needs a lot of work and there are no tests yet, it is better to close it and to revisit it later on with a fresh implementation rather than leaving it open and keeping it in the queue for several years. By the way, I think that this patch can be simplified quite a bit given the current code base, so revisiting this is not only a good idea for the tests, but also for the code quality. Keep in mind that this patch was written two years ago. |
I completely agree with the above! I'd be happy to try and re-implement this, once we have the necessary testing framework in place. (One of the reasons that I stopped working on it, is that it wasn't clear to me if we really wanted to introduce all this complexity in the viewer.) |
Yes, sorry there's a bit more context. We're are trying to clean up the pull request queue and only have actively worked on(within the last month) things there. This will hopefully leave less pulls in an unresolved limbo like we currently have. |
Thanks. Appreciate the info. |
@Snuffleupagus i know this has been discussed, but will this be implemented in the soon future? :) Saw the demo of this by you, is it possible to use that solution until the official release? :) |
As outlined in #3723 (comment), further work on this is blocked on test coverage for the viewer. Hence it's currently not possible to provide any time-line for this.
I suppose that it's technically possible. However, in its current state, the PR will most likely not work with an up-to-date version of PDF.js. (Please note that it doesn't make sense for me to continue working on this, until such a time as it's actually possible for this feature to land.) |
@Snuffleupagus: Is there any chance, that Your PR d81c30b would be working on actual version of pdf.js ? Disregarding tests my team is desperately need this feature. |
@Snuffleupagus @michal-drozd I also have a need for this feature. Is there any hope of getting the code working on a current version of pdfjs? |
This is already answered in #3723 (comment). |
@timvandermeij Its too bad development of such a crucial feature is hinged on #6505 which seems to be stuck. Until then, I guess I am using 0.8.852 on a production site. Aside from performance drawbacks, the 2 page view implemented in this PR by @Snuffleupagus is excellent. |
Any chances of this being accepted anytime soon? |
Another pull request is currently in the review queue that implements this in an easier way. |
This PR is the continuation of the work that @Moistly and @waddlesplash started in PRs #2395 and #2660.
Please note that I got permission from @waddlesplash on IRC to take over the implementation of this feature.
Given that the last actual coding in #2660 was done six months ago, it was easier for me to start fresh rather that trying to patch the old code. Compared to the old implementation, this PR tries to add as much of the code as possible in separate files to avoid cluttering viewer.js too much.
Based on a recent IRC discussion, this PR is on hold until we have implemented testing that covers the viewer.
Things left to do in this PR:
Fixes #590.
Fixes #1475.
Fixes #2376.
Fixes #3658.
Fixes bug 786602.
Fixes bug 864440.