Copy link to clipboard
Copied
Good morning! I am creating a PDF document that will be fillable through Reader, and there will be several buttons that are programmed with JavaScript to send the document to a different printer depending on the need. My goal is to create a quick way to send these documents with one or two clicks, and no involvement from the user on which printer they need to choose.
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!
Thank you to those that answered. I ended up just adding a second set of javascript that runs just before the print command. This fills in a date box I already needed with the date and time the button was hit, then prints the document.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I guess a better way of phrasing this would be to get a confirmation that it was sent to the printer sucessfully?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I believe so, but you'll have to test it...
Copy link to clipboard
Copied
Thank you to those that answered. I ended up just adding a second set of javascript that runs just before the print command. This fills in a date box I already needed with the date and time the button was hit, then prints the document.
Copy link to clipboard
Copied
Acrobat has a document "Did Print" event that you can attach some JavaScript to. It will run when the job makes it into the print queue... it doesn't guarantee that it makes it to paper. Look in JavaScript / Document Actions.