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

Hook page labels into the viewer #6902

Closed
timvandermeij opened this issue Jan 20, 2016 · 9 comments
Closed

Hook page labels into the viewer #6902

timvandermeij opened this issue Jan 20, 2016 · 9 comments

Comments

@timvandermeij
Copy link
Contributor

Thanks to #6803 we have API support for page labels. We need to decide if/how we want to hook this into the viewer. Yury suggested we might show these in the thumbnails panel. Adobe also uses these labels in the page number box, but when we do this we must be careful not to confuse users (if a user enters 1, does he mean page index 1 or page label 1?).

@Celti
Copy link

Celti commented Jan 22, 2016

As an end user, lack of support for use of page labels as page numbers is one of the primary reasons I don't use PDF.js. 99% of the PDFs I use regularly (weekly, if not daily) use page labels to maintain consistence of page numbering between print and PDF editions with lots of cross-referencing by number (label) between documents.

I am of the strong opinion there should at least be a configurable option to allow the use of page labels in the page number box — though I would be fine if that is not default, or requires a prefix, or similar.

@timvandermeij
Copy link
Contributor Author

@Celti Thank you for your feedback! It helps us to assess the importance of the issue. As a user, do you think the behavior of Adobe Reader/Acrobat is the most intuitive? If not, how would you suggest that this should work to not confuse users as mentioned above? The situation I'm afraid of is when we have page labels [i, ii, iii, 1, 2, 3, ...]. When a user enters ii in the page number box, it's clear where to go, but when he enters 1, where do we navigate to? The page with page index 1 (i.e., page i or literally the first page) or the page with page label 1 (i.e., the fourth page)? How do other readers deal with this?

Ideas for a logical implementation in the viewer are appreciated since most of us don't use this on such a regular basis and we want to make sure that the implementation is intuitive.

@Snuffleupagus
Copy link
Collaborator

How do other readers deal with this?

For files containing page labels, it seems that in Adobe Reader 1 means the label named "1" (provided it exists). If there's no such page label, then 1 goes to the first page (probably intended as a fallback).

[...] to make sure that the implementation is intuitive.

For consistency, it might make sense to try and mimic the behaviour of Adobe Reader, since that might be what people expect (even if that isn't perhaps the most intuitive).

@yurydelendik
Copy link
Contributor

Please also notice that UI is different in two cases:
mif1m1u

[__] (1 of 4) vs [__] / 4

@Celti
Copy link

Celti commented Jan 22, 2016

What I currently use is SumatraPDF, which allows you to enter page labels in the text box, but shows both the current page label and the actual discrete page number.

pdf

If you enter a page label, it takes you to that page label. If you enter something not a valid page label for the current document, it tries to interpret it as a page number, allowing a shortcut of, e.g., '100!' to take you to the physical page 100 and not page label 100 (assuming 100! doesn't exist as a page label).

It seems to me that one could either do page labels by default and define '!100' or similar as a 'go to physical page' command, or do physical pages by default and have '!label' take you to the labelled page.

@Snuffleupagus
Copy link
Collaborator

I'll try to prototype something similar to Adobe Reader (visually/functionality wise) for this feature, just to better help us assess the potential implementation/interaction issues with this feature.

@Snuffleupagus
Copy link
Collaborator

I'll try to prototype something similar to Adobe Reader (visually/functionality wise) for this feature, just to better help us assess the potential implementation/interaction issues with this feature.

Please see the following prototype: master...Snuffleupagus:page-labels-viewer.

@timvandermeij
Copy link
Contributor Author

I think this is a pretty clean solution! If you can add the preference to https://github.com/mozilla/pdf.js/blob/master/extensions/chromium/preferences_schema.json and create a PR for it, we can review this further (and create previews for testing).

@timvandermeij
Copy link
Contributor Author

Closing as fixed by #6945.

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

4 participants