最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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 print if cancel button clicked 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');
}
}
});
发布评论

评论列表(0)

  1. 暂无评论