Access format field property with a script

Participant ,
May 16, 2019

Copy link to clipboard

Copied

Is it possible to extract the formatting property of a text field with a script?

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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

TOPICS
Acrobat SDK and JavaScript

Views

226

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

Access format field property with a script

Participant ,
May 16, 2019

Copy link to clipboard

Copied

Is it possible to extract the formatting property of a text field with a script?

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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

TOPICS
Acrobat SDK and JavaScript

Views

227

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
May 16, 2019 0
Most Valuable Participant ,
May 16, 2019

Copy link to clipboard

Copied

What do you mean by "formatting property", exactly?

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...
May 16, 2019 0
Participant ,
May 16, 2019

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?

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...
May 16, 2019 1
Adobe Community Professional ,
May 16, 2019

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

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...
May 16, 2019 0
Most Valuable Participant ,
May 16, 2019

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.

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...
May 16, 2019 1
Participant ,
May 16, 2019

Copy link to clipboard

Copied

Thanks.

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...
May 16, 2019 0
Participant ,
May 16, 2019

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.

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...
May 16, 2019 0
Most Valuable Participant ,
May 16, 2019

Copy link to clipboard

Copied

Nope, not possible.

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...
May 16, 2019 1
Adobe Community Professional ,
May 16, 2019

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.

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...
May 16, 2019 0
Participant ,
May 16, 2019

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).

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...
May 16, 2019 2
Adobe Community Professional ,
May 16, 2019

Copy link to clipboard

Copied

Ha ha, very clever. Elimination strategy

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...
May 16, 2019 0
try67 LATEST
Most Valuable Participant ,
May 16, 2019

Copy link to clipboard

Copied

Nice one!

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...
May 16, 2019 0