This code in brackets [var pp = this.getPrintParams();pp.interactive = pp.constants.interactionLevel.automatic;pp.printerName = "PRINTER NAME";this.print(pp);] works great for sending it to the specified printer, I just make a quick modification to the printer name and VOILA! However, there is no feedback to the user that the document did indeed print. It would be nice to have that feedback before they clear the form and start on the next task.
So my question is this: is there a way to have the above code run, then to run another code that pops up a simple "Hey, that thing printed correctly!" after confirming it did indeed print? Is this possible with JS? Thank you in advance for your help!
It's not possible to confirm it actually did print (put it on paper), not even in theory. Printers often get on with their work entirely independently of the computer, and if they lose it the computer never knows.
I guess a better way of phrasing this would be to get a confirmation that it was sent to the printer sucessfully?
The only thing you can do is put a try-catch clause around the print command, and then display an error message in case one happened, but it's not guaranteed that if there was no error the file was actually printed.
Would a command like this confirm if it was sent to the printer at least? I guess that is all I really want to know...that the document did it's job and just sent to the printer.
I believe so, but you'll have to test it...
Copy link to clipboard