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

Only warn about unsupported JavaScript, in the viewer, when non-empty actions exist (issue 5767) #9009

Merged
merged 1 commit into from
Oct 8, 2017

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Oct 8, 2017

Some PDF files contain JavaScript actions that consist of nothing more that one, or possibly several, empty string(s). At least to me, printing a warning/showing the fallback seems completely unnecessary in that case.

Furthermore, this patch also makes use of an early return, so that we no longer will attempt to check for printing instructions when no JavaScript is present in the PDF file.

Note: It would perhaps make sense to change the API/core code, such that we ignore empty entries there instead. However, that would probably be considered a breaking changing with respect to backwards compatibility, hence this simple viewer only solution.

Fixes #5767.

Edit: The existing test-files issue6106.pdf and bug1001080.pdf could be used to check that this patch doesn't break the warning/fallback in cases where it's still applicable.

Edit2: Patch updated only to fix stupid typos in the commit message!

@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

… actions exist (issue 5767)

Some PDF files contain JavaScript actions that consist of nothing more that one, or possibly several, empty string(s). At least to me, printing a warning/showing the fallback seems completely unnecessary in that case.

Furthermore, this patch also makes use of an early `return`, so that we no longer will attempt to check for printing instructions when no JavaScript is present in the PDF file.

*Note:* It would perhaps make sense to change the API/core code, such that we ignore empty entries there instead. However, that would probably be considered a breaking changing with respect to backwards compatibility, hence this simple viewer only solution.

Fixes 5767.
@mozilla mozilla deleted a comment from pdfjsbot Oct 8, 2017
@mozilla mozilla deleted a comment from pdfjsbot Oct 8, 2017
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Oct 8, 2017

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/f6c2559a1a334e8/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Oct 8, 2017

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/f6c2559a1a334e8/output.txt

Total script time: 2.58 mins

Published

@timvandermeij timvandermeij merged commit c802377 into mozilla:master Oct 8, 2017
@timvandermeij
Copy link
Contributor

Thank you!

@Snuffleupagus Snuffleupagus deleted the issue-5767 branch October 8, 2017 17:47
@Snuffleupagus Snuffleupagus mentioned this pull request Oct 27, 2017
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Only warn about unsupported JavaScript, in the viewer, when non-empty actions exist (issue 5767)
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.

Error: JavaScript is not supported
3 participants