I'm having difficulties to show print modal passing a pdf file.
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)
It is happing just with pdf files, I tested with image like logo.png
and it worked. I insert that params to callback to trying to figured out what is happing, and OnPrintDialogClose()
is trigged, but the modal box did not show! The screen blink and this message is showed 'The print dialog was closed'
.
Any suggestion?
Looking at https://printjs.crabbly.com/#configuration I see there are some more configuration options that might give you clues. I would recommend trying this (I added onError and modalMessage):
Then my troubleshooting questions would be: