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

How can I get a feedback after click printButton or cancelButton? #7558

Closed
xingxiaoyiyio opened this issue Aug 23, 2016 · 3 comments
Closed

Comments

@xingxiaoyiyio
Copy link

Web browser: Chrome

I click printButton on viwer.html, then it triggers the browser method of window.print(),
it open a preview page.

Here is the problem:
How can I get a feedback after click printButton or cancelButton on this preview page see blow?
because I need to execute a callback function after print success but not cancel printing.

pages

@Snuffleupagus
Copy link
Collaborator

@xingxiaoyiyio
Copy link
Author

thanks for your kindly reply, I have tried to listen for the afterprint event but that is not I really want, since afterprint event is fired when the printing dialog closed no matter I click print button or cancel print button at last on the open window of printing dialog.

what make me puzzled is that the event window.print() has no any return value to let me know whether it print successful or cancel or stop printing.

so how I can confirm my printing task really success but not be cancel at last?

在 2016年8月23日,下午7:43,Jonas Jenwald notifications@github.com 写道:

You should be able to listen for the afterprint event (see https://developer.mozilla.org/en-US/docs/Web/Events/afterprint https://developer.mozilla.org/en-US/docs/Web/Events/afterprint and https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onafterprint https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onafterprint), which is the event that the viewer uses to cleanup after printing (in https://github.com/mozilla/pdf.js/blob/master/web/app.js#L2312-L2314 https://github.com/mozilla/pdf.js/blob/master/web/app.js#L2312-L2314 and https://github.com/mozilla/pdf.js/blob/master/web/app.js#L1167-L1180 https://github.com/mozilla/pdf.js/blob/master/web/app.js#L1167-L1180).

Closing as answered.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #7558 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ARE_brB9oi2RsgZZlewPzU0umg7nzfvTks5qitz9gaJpZM4Jqhtd.

@aqlu
Copy link

aqlu commented Feb 15, 2019

@xingxiaoyiyio Did you find a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants