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

Re-factor how printing is triggered in the default viewer #12426

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

Snuffleupagus
Copy link
Collaborator

This adds a new PDFViewerApplication.triggerPrinting method, which takes care of checking that printing is actually supported before calling window.print, to remove the need to duplicate that code in multiple places.

Also, removes the PDFViewerApplication.printing getter since it's not really necessary any more.

This adds a new `PDFViewerApplication.triggerPrinting` method, which takes care of checking that printing is actually supported before calling `window.print`, to remove the need to duplicate that code in multiple places.

Also, removes the `PDFViewerApplication.printing` getter since it's not really necessary any more.
if (triggerAutoPrint) {
setTimeout(function () {
window.print();
setTimeout(() => {
Copy link
Collaborator Author

@Snuffleupagus Snuffleupagus Sep 30, 2020

Choose a reason for hiding this comment

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

Note that I'm not actually sure if/why setTimeout is (still) necessary here!?

As far as I can tell, this was present already in PR #2839 which originally added the auto-print feature, hence there's probably a good reason for this.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

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/04119970d08e853/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/04119970d08e853/output.txt

Total script time: 3.64 mins

Published

@timvandermeij timvandermeij merged commit 88f72d6 into mozilla:master Sep 30, 2020
@timvandermeij
Copy link
Contributor

Thank you for simplifying this!

@Snuffleupagus Snuffleupagus deleted the app-triggerPrinting branch September 30, 2020 20:35
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