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

Custom Toolbar Button for custom dynamic stamp

drosales
Registered: Jun 3 2011
Posts: 25
Answered

Hello all,
 
My question is basically my subject line. I've been reading and experimenting and now i'm confused. Ive created a custom menu item. Ive created a custom toolbar button, but can i create a custom toolbar button that runs a JS for a custom dynamic stamp.
 
thank,
Daniel-

My Product Information:
Acrobat Pro 10.1, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
If you want to set up a toolbar button that selects a particular stamp, that can be tricky. Thom Parker discusses the issues in an article on his pdfscripting.com site, but you'll have to become a member to read the "Automating Stamps" article. The problem is the mechanism used is no longer available with Acrobat 10. I'm not aware of a workaround.

If you want the toolbar button to do something else, like automatically place a stamp somewhere, that is easier and covered in the article. In short, you'd use the doc.addAnnot method.
drosales
Registered: Jun 3 2011
Posts: 25
Well what about a button for a stamp thats not dynamic. is that possible?
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
If you could explain exactly what you want the toolbar button to do, it will help. For example, do you want the stamp to be selected when the toolbar button is clicked (so the user can place it), or do you want the stamp to be applied to the current page at a particular location?
drosales
Registered: Jun 3 2011
Posts: 25
Sorry about that. more info would definately help. i would like it to do what your first example describes. when the button is clicked, the stamp is selected and the user can place it.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
As mentioned in my first response, I don't know of a way to do that with Acrobat 10. If you're lucky, Thom will notice this discussion and provide more info.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accepted Answer
In the old (pre-X) Acrobat, there were a set of menu items for the stamp tools, so it was possible to create a toolbar button that ran the stamp menu item with the "app.execMenuItem" fucntion. But not anymore. In Acrobat X those menu items are history.

Now, to create a toolbar button that acts like it runs the stamp tool is a bit tricky. What you have to do is write a script that places a transparent form field button over the entire page. Then adds a MouseUp script to the button to places the stamp you are interested in at the cursor location. I've written up scripts that actually create the stamp right away at 50% opacity and then use a timer to track the mouse movement so the stamp moves with the mouse until the button is clicked. Its a very nice UI.

There are articles and sample scripts for members at www.pdfscripting.com

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

drosales
Registered: Jun 3 2011
Posts: 25
Thanks Thom,

I knew it was possible because i saw it in your "Stamps Gone Wild" video. I am planning on purchasing a membership to your PDFScripting.com website and purchasing a copy of Acro buttons. thanks again to everyone on the forum!

Daniel-