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

Display Machine/Username

kumudb
Registered: Oct 9 2006
Posts: 2

Hello, I am trying to write a script that will be executed when document is printed. This script has to say something like printed this on from . Is there a simple way to achieve this? Users will have readers only on their machine.
thanks
Kb

My Product Information:
Acrobat Standard 6, Windows
tedpadova
ExpertTeam
Registered: Dec 31 2005
Posts: 848
YES.... it's a neat little feature using Acrobat JavaScript. Open the Advanced menu and select Document Processing > Document Actions. In the Document Actions dialog box you have chocies for Will Print (executing the script before the file is printed) and Did Print (executing the script after the document is printed) and a few other options.To add a script to the Did Print item, select Document Did Print and click Edit. The JavaScript Editor opens.

Type the following code:

var msg = "Printed this form."
app.alert(msg);

Note that what you see in quotes can be edited to reflect with the message you want to display.

When a user prints your form an application alert dialog box opens reporting the message.

ted

The author of numerous books on Acrobat, Photoshop, Illustrator and the Adobe Creative Suite, and an international speaker on Adobe Acrobat, Ted Padova is a well-known PDF guru.

merritt
Registered: Jan 22 2008
Posts: 8
Ted,

What if you wanted to display a confirmation box using AcroJS to the user each time the print button is clicked and force the user to click OK to continue printing or Cancel to cancel the print job.

We have a subset of users that need to see a special message before certain types of documents are printed. I'd like to listed for the print event, capture it, and run it through a confirmation function. Is that possible? Your example of using "This Will Print" would be nice but the message displays after the user selects a printer and starts the print job.

Also, is there a way to change the title of an Alert in AcroJS?

Thanks in advance for any help you can provide!

Regards,
Merritt