Copy link to clipboard
Copied
Is it possible to customize the format of fields globally, like in a json file or something. We are prepairing a large number of forms with the following requiste
Date: dd.mm.yyyy
Number: 2 decimals: 1'234.56
Soc. security: 999.9999.9999.99
None of the other, build in formats are needed.
Is it possible to set this standards per JavaScript?
As mentioned, no, this is not possible in Acrobat.
You can use a script to do it, like this (paid-for) one I've developed (https://www.try67.com/tool/acrobat-apply-format-to-multiple-text-fields) which allows you to process fields based on their name, so if you name all your date field "Date_XXX", or all the SSN fields "SSN_", or something like that, you could specify that pattern to it and apply the desired Format setting to all those fields in a single process.
Copy link to clipboard
Copied
No, there is no easy way as in the browser based JavaScript that you are referring to. You can however write a script that goes through all fields and then sets the appropriate field scripts via the Field.setAction() function: https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/index.html#t=Acro12_MasterBook%...
Copy link to clipboard
Copied
Took me a little bit to find this, but apparently I wrote about how to do this seven years ago 🙂
Copy link to clipboard
Copied
I'm doing that already for the fonts and checkmarks.
app.addMenuItem({
cName: "Set Fields",
cParent: "Edit",
cExec: "set_all_fields();"
});
function set_all_fields()
{
console.show();
for(var n=0; n<this.numFields; n++) {
var fieldName = this.getNthFieldName(n);
var field = this.getField(fieldName);
console.println(fieldName);
switch(field.type) {
case 'text' :
field.textFont = 'Arial';
field.textSize = 9;
break;
case 'checkbox':
field.style = style.ch;
break;
default: console.println(field.type);
break;
}
}
}
But unfortunately I don't know the names of the fields as Acrobat assigns its own fieldnames from the surrounding elements (randomly it seems).
But try67 suggestion might help me here. will try and post
Copy link to clipboard
Copied
As mentioned, no, this is not possible in Acrobat.
You can use a script to do it, like this (paid-for) one I've developed (https://www.try67.com/tool/acrobat-apply-format-to-multiple-text-fields) which allows you to process fields based on their name, so if you name all your date field "Date_XXX", or all the SSN fields "SSN_", or something like that, you could specify that pattern to it and apply the desired Format setting to all those fields in a single process.
Copy link to clipboard
Copied
btw try67. we might be tempted to buy your Format tool. Does it still work on windows 10/11?
Copy link to clipboard
Copied
Yes, it does!