Skip to main content
Correct answer JR Boulay

The function is placed as a document script ( ==> https://www.pdfscripting.com/public/Document-Level-Scripts.cfm)

The function is called in the "words" field : Properties : Calculation

4 replies

JR Boulay
Community Expert
Community Expert
April 3, 2025

This demo PDF was supplied with Acrobat 5, and I've kept it carefully ever since (attached).

 

Acrobate du PDF, InDesigner et Photoshopographe
Participant
April 3, 2025

Is exactly what I need to do. Do you know what sample code I can use for this?

AnandSri
Legend
April 3, 2025

Hello!

 

I hope you are doing well.

 

You can try the selling sample script, and you may need to customize it to your requirements: 

 

var num = this.getField("NumericFieldName").value;
event.value = ConvertToWords(num);

 

Or

 

var decimalValue = this.getField("DecimalField").value;
this.getField("TextField").value = decimalValue.toString();

I hope this helps. To learn more about the JavaSripts in PDF forms, see this article: https://adobe.ly/4iWmBd8
Thanks,
Anand Sri.
try67
Community Expert
Community Expert
April 3, 2025

Do you mean that if the first field shows "10.23" then the second one should show "Ten and twenty three hundredths" or something like that? If so, it's possible using a script, but it's a pretty complex task...

 

If you're interested in hiring a professional to create it for you, feel free to contact me privately by clicking my user-name and then on the blue "Message" button.

PDF Automation Station
Community Expert
Community Expert
April 3, 2025

Please be more specific with an example.

Participant
April 3, 2025

I have a decimal field with the amount of 349.000 and I need based on this number, to fill another text field that indicates “trescientos cuarenta y nueve mil” in Spanish. The decimal field is dynamic. I tried to do it with code but I still can't do it.

creative explorer
Community Expert
Community Expert
April 3, 2025

@intuitive_mind9098 officially, the only way around that is using JavaScript within the form. 

m
Participant
April 3, 2025

Do you have an example of a code that does this? I've been trying to do it but with no results yet.