Highlighted

Get Text Field Format

New Here ,
Aug 14, 2020

Copy link to clipboard

Copied

Hi,

I require some help regarding JS in Acrobat DC.

I've been looking in every document and every corner of the internet and I just can't seem to find what I need.
What I require is to programically get the format currently applied to a text field, (for example, none, number, percentage, etc.).
To be clear, I do not need to know what type of data would currently be in the field's .value, as it can have nothing at all at that moment.
What I need to know is what that field is currently formatted for (Properties > Format).

Also, yes, I know you can just apply the right format to that field programmically like

AFNumber_Format(2, 0, 0, 0, "", true);

That is also not what I want. I want to apply further code on the field only if it is configured for a wrong date or number format. And for that I need to know what format it has beforehand.


I'm trying to develop scripts to automatically detect wrong formats being applied to certain fields in large files, please help me out if you have any clue.

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

31

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Get Text Field Format

New Here ,
Aug 14, 2020

Copy link to clipboard

Copied

Hi,

I require some help regarding JS in Acrobat DC.

I've been looking in every document and every corner of the internet and I just can't seem to find what I need.
What I require is to programically get the format currently applied to a text field, (for example, none, number, percentage, etc.).
To be clear, I do not need to know what type of data would currently be in the field's .value, as it can have nothing at all at that moment.
What I need to know is what that field is currently formatted for (Properties > Format).

Also, yes, I know you can just apply the right format to that field programmically like

AFNumber_Format(2, 0, 0, 0, "", true);

That is also not what I want. I want to apply further code on the field only if it is configured for a wrong date or number format. And for that I need to know what format it has beforehand.


I'm trying to develop scripts to automatically detect wrong formats being applied to certain fields in large files, please help me out if you have any clue.

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

32

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 14, 2020 0
New Here ,
Aug 14, 2020

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 14, 2020 0