Copy link to clipboard
Copied
Is it possible to extract the formatting property of a text field with a script?
1 Correct answer
No, all the field formatting options are actually predefined scripts. And there is no way from script, to get access to an existing script. It would be really helpful if you could, but you can't
Copy link to clipboard
Copied
What do you mean by "formatting property", exactly?
Copy link to clipboard
Copied
In the field properties, the format tab where you can format numbers, dates, percentages, etc. Is there a script that will tell what the formatting, if any, is for that field?
Copy link to clipboard
Copied
No, all the field formatting options are actually predefined scripts. And there is no way from script, to get access to an existing script. It would be really helpful if you could, but you can't
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thanks Thom. I realize it's probably because there are unlimited variations, but even if a script could tell me the formatting is not "none" would be helpful.
Copy link to clipboard
Copied
Nope, not possible.
Copy link to clipboard
Copied
Yeah, short of actually parsing the binary PDF file contents, you can't get access to anything about the field formatting info.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
I figured it out. I'm trying to get a list of text fields that are formatted (but no details). I looped through the fields and I set the dirty flag to false, forced the formatting to none using setAction(), tested the dirty flag (if true, the formatting changed from something to none, if false nothing changed - the formatting was already none).
Copy link to clipboard
Copied
Ha ha, very clever. Elimination strategy
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Nice one!
Copy link to clipboard
Copied
I see. Unfortunately, no, you can't access it. Nor can you access the formatted value, only the actual one.
Copy link to clipboard
Copied
Thanks.

