crabbly / crabbly/Print.js

I could not find a way to determine if the user clicked the "Print" or "Cancel" button

Open
#712 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.5k
Forks
688
PR merge metrics
No merged PRs in 30d

Description

PrintJS Printing is working fine, but I could not find a way to determine if the user clicked the Print or Cancel button. Please help me to get it resolve this issue. I dont want to do any stuff if cancel button clicked in print dialog box of printJS

I tried to print Base64 pdf file using PrintJS library, it opens print dialog box with print and cancel option. If I clicks on print pdf getting printed and if I clicks on cancel it is not printing. This logic working fine.

But if successful printing I want to do some logic not for cancelled pdfs.

Here how can I identify whether print button clicked or cancel button clicked? in the printJS library.

can anyone help me to get it complete.

Example:

printJS({
printable: data,
type: 'pdf',
base64: true,
onPrintDialogClose: function (event) {
if (event === true) {
alert('Print button clicked');
} else {
alert('Cancel button clicked');
}
}
});

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.