我有困难显示打印模式传递一个pdf文件。
setTimeout(() => {
printJS({
printable: '53544.pdf',
type: 'pdf',
showModal: true,
fallbackPrintable: () => console.log("FallbackPrintable"),
onPrintDialogClose: () => console.log('The print dialog was closed'),
onIncompatibleBrowser: () => console.log('Pdf was opened in a new tab due to an incompatible browser')
})
console.log("TimeOut Executado");
}
,3000)它只是发生在pdf文件,我测试的图像,如logo.png和它的工作。我插入这个参数来回调,试图找出发生了什么,OnPrintDialogClose()被触发了,但是模态框没有显示出来!屏幕闪烁,这条消息显示为'The print dialog was closed'。
有什么建议吗?
发布于 2020-11-29 04:19:09
看看https://printjs.crabbly.com/#configuration,我发现还有一些更多的配置选项可能会给您提供线索。我建议试一试(我添加了onError和modalMessage):
setTimeout(() => {
printJS({
printable: '53544.pdf',
type: 'pdf',
showModal: true,
modalMessage: "Document Loading...",
onError: (err) => console.log(err),
fallbackPrintable: () => console.log("FallbackPrintable"),
onPrintDialogClose: () => console.log('The print dialog was closed')
});
console.log("TimeOut Executado");
}, 3000)那么,我的疑难解答问题将是:
https://stackoverflow.com/questions/65056641
复制相似问题