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

Remove/deprecate specifying a pageNumber directly after the hash symbol (#), to improve compatibility since other PDF viewers don't support this form (issue 7746) #7757

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

Snuffleupagus
Copy link
Collaborator

There's no mention of our #{pagenum} form in http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf, and Adobe Reader doesn't seem to support it either.
Hence this patch removes support for it in the extensions, but keeps it in the GENERIC build with a deprecation warning and a fallback to handle it as a destination.

Fixes #7746.

@Snuffleupagus Snuffleupagus changed the title Remove/deprecate specifying a pageNumber directly after the hash symbol (#), to omprove compatibility since other PDF viewers don't support this form (issue 7746) Remove/deprecate specifying a pageNumber directly after the hash symbol (#), to improve compatibility since other PDF viewers don't support this form (issue 7746) Oct 27, 2016
} else { // Named (or explicit) destination.
if ((typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) &&
(isPageNumber(hash) && hash < this.pagesCount)) {
Copy link
Contributor

@timvandermeij timvandermeij Oct 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be hash <= this.pagesCount. Try with the Tracemonkey paper: #13 will give the warning, #14 will not, even though it's a valid page number.

Moreover, we can get rid of the extra parentheses around the condition on this line, which makes it slightly easier to read in my opinion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh! You're obviously correct, don't know how I managed to make that kind of mistake in such a small patch. Good eye, thanks :-)

…ol (#), to improve compatibility since other PDF viewers don't support this form (issue 7746)

There's no mention of our `#{pagenum}` form in http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf, and Adobe Reader doesn't seem to support it either.
Hence this patch removes support for it in the extensions, but keeps it in the `GENERIC` build with a deprecation warning and a fallback to handle it as a destination.

Fixes 7746.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/6a4dc89bc19e789/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/6a4dc89bc19e789/output.txt

Total script time: 2.73 mins

Published

@timvandermeij timvandermeij merged commit 1c3fb17 into mozilla:master Oct 27, 2016
@timvandermeij
Copy link
Contributor

Nice work!

@Snuffleupagus Snuffleupagus deleted the setHash-remove-pageNumber-directly-after-hash branch October 27, 2016 22:01
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
…eNumber-directly-after-hash

Remove/deprecate specifying a pageNumber directly after the hash symbol (#), to improve compatibility since other PDF viewers don't support this form (issue 7746)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants