Adobe acrobat forms javascript object specification Benutzerhandbuch

Seite von 64
Acrobat Forms - JavaScript Object Specification
53
Util Object
The Util Object is a static JavaScript object that defines a number of utility methods and
convenience functions for string and date formatting.
Util Object Methods
printf
Parameters: cFormat
Returns: cResult
This method will format one or more values as a string according to a format string. This is
similar to the C function of the same name.
printx
Parameters: cMask, …
Returns: cResult
This method formats a source string according to a masking string. Valid masking values are as
follows:
To format a string as a U.S. telephone number, for example, use the following script:
var v = "aaa14159697489zzz";
v = util.printx("9 (999) 999-9999", v);
console.println(v);
Value
Effect
?
Copy next character.
X
Copy next alphanumeric character, skipping any others.
A
Copy next alpha character, skipping any others.
9
Copy next numeric character, skipping any others.
*
Copy the rest of the source string from this point on.
\
Escape character.
>
Uppercase translation until further notice.
<
Lowercase translation until further notice.
=
Preserve case until further notice (default).