• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Access format field property with a script

Participant ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript

Views

788

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
community guidelines

correct answers 1 Correct answer

Community Expert , May 16, 2019 May 16, 2019

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

Votes

Translate

Translate
Community Expert ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Participant ,
May 16, 2019 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?

Votes

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
community guidelines
Community Expert ,
May 16, 2019 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

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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

Votes

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
community guidelines
Community Expert ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

Nope, not possible.

Votes

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
community guidelines
Community Expert ,
May 16, 2019 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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines
Participant ,
May 16, 2019 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).

Votes

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
community guidelines
Community Expert ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

Ha ha, very clever. Elimination strategy

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines
Community Expert ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

LATEST

Nice one!

Votes

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
community guidelines
Community Expert ,
May 16, 2019 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.

Votes

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
community guidelines
Participant ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

Thanks.

Votes

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
community guidelines