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

Cancelling a stamp that prompts for data

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Answered

I'm creating a dynamic stamp the prompts the user for input using a custom dialog, which contains an OK and Cancel button. (The situation would be the same if I were using an app.response.) My question is can the placement of the stamp be canceled if the user presses the Cancel button, and if so, how? I've tried setting event.rc and event.source.forReal to false, but the stamp still gets placed.

Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Accepted Answer
Hi George,

Funny, we had the same question asked from someone else recently. Unfortunately, a stamp operation cannot be aborted from within a stamp script. The stamp is applied no matter what the stamp script does. Stamp scripts operate within a narrow context. However, if the stamp is applied from an automation script, then the automation script can handle the abort by either not applying the stamp, or deleting the stamp after the operation is complete, depends on how the automation script operates.

Hope this helps,

Dimitri
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Dimitri,

Yes this does help, thank you. I now remember Thom's stamp automation sample (available to subscribers of pdfscripting.com, if anyone is interested) that demonstrates placing a stamp with the mouse. I think the simplest approach for me is to get rid of the Cancel button and live with manually deleting the stamp if needed.

Regards,

George