This is happening on Windows 11.
I’ve created a special HTML page that allows me to render my data via javascript in an HTMLViewer, then I call HTMLViewer.Print to allow the user to send it to their printer.
If the print operation works successfully, there is no problem.
But if there’s a problem printing, for example if I print to the PDF Printer and the user tries to overwrite to a file that’s in use, or if I print to a printer and there’s some kind of hardware problem or print spool failure, my application locks up with no way to catch the error. It has to be force quit.
Has anyone dealt with this before?
Create a sample with steps to replicate the problem. Open an issue report for investigation.
The reason I haven’t done that yet is because it’s not easily reproduceable in code, it requires causing a printer error.
Issue 78162.
This is exacerbated by the .PrintComplete and .PrintError events not firing on Windows.
Is it enough for the printer to run out of paper? That would be readily reproducible.
No, because an out-of-paper error gets handled by the Windows Print Spooler. The error has to occur before it reaches the Print Spooler. I detailed a way to induce it in the issue, but it requires Microsoft Offiice and a special PDF print driver to be installed.
Not tried, but what happens if the print dialog is open and you are ready to press “print” and you turn the printer off and then press print? That’s a “before spooler” fail.