These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Cancel printing

Wiizl
Registered: Feb 17 2008
Posts: 2
Answered

I really need your help to figure out how to cancel document printing if some textfields are'n filled correctly. So far I've made a script in 'will print' event that checks all fields and if neccessary displays the warning messagebox. But the problem is that the user can still print the document. So... does anybody knows some tricks how to stop printing after the user clicks OK on the MsgBox?
This is an emergency!!

My Product Information:
Acrobat Pro 8.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Once the print is started, it can't be stopped from Acrobat JavaScript. It would be nice if "WillPrint" event accepted some kind of cancel parameter, but it doesn't.

At this point the print job can only be stopped with the system print dialogs.

One solution is to make your own print button on the document that uses a script to check for valid field values before calling the "doc.print()" function.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script