Skip to main content
JR Boulay
Community Expert
Community Expert
Feb 14, 2020 3:40 PM UTC
Answered

Select a Stamp with JavaScript

Hi

 

I want to create an add-on button tool, when the user clicks it displays a popup menu (popUpMenuEx), and this menu list some custom stamps, allowing the user to choose one.

 

I don't want to place the stamp on the page, I want the user to have the selected stamp on the cursor, so he just have to clic where he wants to place the stamp.

 

I know how to create a button and a popup, but I don't know how to select a stamp with JavaScript and I cannot find usefull information.

Is it possible?

 

Thank you.

This topic is closed to new replies. Start a new post to keep the conversation going.
JR Boulay
JR BoulayCorrect answer
Community Expert
Feb 17, 2020 4:24 PM UTC

OK, thank you guys.

But I talk too much, I told my client, who did not know, that the Stamps palette is directly accessible in the commenting tools. So he no longer needs a script.

🙂

Acrobate du PDF, InDesigner et Photoshopographe

8 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthorCorrect answer
Community Expert
Feb 17, 2020 4:24 PM UTC

OK, thank you guys.

But I talk too much, I told my client, who did not know, that the Stamps palette is directly accessible in the commenting tools. So he no longer needs a script.

🙂

Translate
Acrobate du PDF, InDesigner et Photoshopographe
Thom Parker
Community Expert
Community Expert
Feb 17, 2020 8:10 PM UTC

Ha ha, The simple obvious solutions are always the best 😉

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
Community Expert
Feb 15, 2020 8:33 PM UTC

Creating such a tool for Reader is possible. 

And you already have the scripts for doing it

https://www.pdfscripting.com/members/Using_the_Mouse_to_Automate_Stamps.cfm?sd=53

 

I'm not sure if it is covered in the article, but I create the stamp as soon as the user selects the button/menu item, give it 50% opacity, and use a time to move it with the mouse. 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
Feb 15, 2020 9:58 AM UTC

It's for a team of Acrobat Reader users. Acrobat Reader don't allow to customize the toolbar icons, so they need a quick access to some stamps.

 

Otherwise, is it possible to use JavaScript to quickly show the Stamp palette?

I cannot find any information about this.

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
Feb 15, 2020 7:06 PM UTC

No, not possible.

Translate
try67
Community Expert
Community Expert
Feb 14, 2020 4:40 PM UTC

No. Why not use the built-in Stamp tool, instead? What you can do with a script is apply a specific stamp to a certain position on the page, though, and then the user can move it around, but you can't "pre-select" it and attach it to the mouse cursor.

Translate