Skip to main content
Participant
March 5, 2025
Answered

Dynamic Stamp - Text Wrapping with JavaScript

  • March 5, 2025
  • 2 replies
  • 433 views

I'm building a custom pdf for my organization to use on its documents. I was able to give it fields for things like name, title and date. But they would like me to field to enter a short description or sentence. The issue I'm running into is while users can input long strings it becomes cut off once they reach the end of the text box. I know I need to give it a wrapping function to drop the text down to show the full user input but I have a very rudimentary understanding of JavaScript as I'm learning as I go and could use some help.

I applied my current code to show what I'm working with.

 

var cAsk = "Enter Narrative" ;
var cTitle = "Narrative";

if(stampState == 'applying')
{​​​​
var cMsg = app.response(cAsk, cTitle);
event.value = cMsg;
}​​​​

 

 

Correct answer Thom Parker

This is a somewhat avanced task that requires some study. For example, there is no stampState property or value. 


See these article for information on creating a dynamic stamp:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets/

https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm

https://www.pdfscripting.com/public/ACRODIALOGS-OVERVIEW.cfm

 

2 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
March 5, 2025

This is a somewhat avanced task that requires some study. For example, there is no stampState property or value. 


See these article for information on creating a dynamic stamp:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets/

https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm

https://www.pdfscripting.com/public/ACRODIALOGS-OVERVIEW.cfm

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
March 5, 2025

You can't do it using the app.response method. You must use a dialog object with a multi-line text field.