Skip to main content
JR Boulay
Community Expert
Community Expert
February 14, 2020
Answered

Select a Stamp with JavaScript

  • February 14, 2020
  • 4 replies
  • 1211 views

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 has been closed for replies.
Correct answer JR Boulay

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.

🙂

4 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthorCorrect answer
Community Expert
February 17, 2020

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
Thom Parker
Community Expert
Community Expert
February 17, 2020

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

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
Community Expert
February 15, 2020

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. 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
February 15, 2020

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.

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
February 15, 2020

No, not possible.

try67
Community Expert
Community Expert
February 14, 2020

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.