Hello,

Given an input PDF and a bunch of editable fields, PDTextField included, I
would like to apply any restriction / action that textfield has on any
input that I am trying to set for that text field.
For example, if the textfield accepts only numbers, any value that I am
trying to set for that field should not have alphabets and special
characters.
I am able to retrieve the javascript action signature by using the
following code:

PDActionJavaScript jst=(PDActionJavaScript) field.getActions().getK(); //
provided nothing is null
jst.getAction().getAsString(); // This gives me the JS signature alone.

Some of the signatures that I have noticed with a bunch of input PDFs that
have restrictions on text fields are:
1.FCEmail_Validate --> makes sure entered text is email
2. FCDate_Keystroke(FC_INVALID_DATE_WARNING, 'mm/dd/yyyy') --> makes sure
entered text is a date with the specified format.
Similarly there are many other javasript methods for other restrictions
such as float, integer etc.,

How can I get hold of the logic or contents of such javascript methods? Are
these predefined adobe javascript methods? When I searched for these
methods, I did not find any reference to Adobe site. Could any of you
please let me know how to apply these actions when I try to set a value to
a field using field.setValue(<input>)?

Thanks,
Balaji

Reply via email to