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

Change default form field font

Participant ,
Feb 22, 2017 Feb 22, 2017

I know there must be an easy solution to this and I am sure I am not the only one to ask.

When I export an interactive PDF from InDesign, the text fields inherit Times New Roman as the default field font.

It doesn't matter what paragraph style is default in InDesign.

Is there a way to change the default font in Adobe Acrobat Pro XI globally so that it defaults to whatever I choose?

Thanks in advance.

Alan

TOPICS
PDF forms
23.2K
Translate
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
1 ACCEPTED SOLUTION
Participant ,
Feb 23, 2017 Feb 23, 2017

Again that is not even a vaguely useful answer and it says by your profile that you are an expert.

My question relates to the default font in Adobe Acrobat for form fields. I don't want to 'click' on anything.

I have found a solution elsewhere posted by someone that is not an expert - just someone that needed an answer and put in the time to find one.

It is beautiful and it is a javascript that is run as an action.

To do this in Adobe Acrobat XI, open Tools and then Action Wizard. Click on 'Create New Action' - Select 'More Tools' and choose ' Execute JavaScript.' Click the arrow icon in the centre 'Add to right hand pane.' There should now be a new untitled action. Double click on 'Specify Settings and paste in the script below.

for (var i = 0; i < numFields; i++) {

    var fName = getNthFieldName(i);

    var f = getField(fName);

    if (f.type === "text") {

//      f.alignment ="center";

        f.textSize = 6;

        f.textFont = "Helvetica";

        // Other properties go here

    }

}

The only part that didn't work was the 'center' Font type and size does which is really a great leap forward for my purposes.

Just tweak it to your liking. I found that when you specify the font, there must be no space so for example Open Sans would be OpenSans

I hope this helps someone in the near future.

View solution in original post

Translate
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 ,
Feb 22, 2017 Feb 22, 2017

Since the fields are created in InDesign you should ask your question over at the ID forums. Acrobat is not involved in this process.

If you created your fields in Acrobat (which is a better idea anyway, IMO) then yes, you would have been able to set the default font used for them.

Translate
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 ,
Feb 22, 2017 Feb 22, 2017

My question is solely related to Acrobat Pro XI. I want to change it's default font globally.

Translate
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 ,
Feb 23, 2017 Feb 23, 2017

You can change the font for new fields that you are creating. You can't change it automatically for all fields in all pre-existing documents that you open...

To do the former change one field and then right-click it in Form Edit mode and select Use Current Properties As New Defaults.

Translate
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 ,
Feb 23, 2017 Feb 23, 2017

Again that is not even a vaguely useful answer and it says by your profile that you are an expert.

My question relates to the default font in Adobe Acrobat for form fields. I don't want to 'click' on anything.

I have found a solution elsewhere posted by someone that is not an expert - just someone that needed an answer and put in the time to find one.

It is beautiful and it is a javascript that is run as an action.

To do this in Adobe Acrobat XI, open Tools and then Action Wizard. Click on 'Create New Action' - Select 'More Tools' and choose ' Execute JavaScript.' Click the arrow icon in the centre 'Add to right hand pane.' There should now be a new untitled action. Double click on 'Specify Settings and paste in the script below.

for (var i = 0; i < numFields; i++) {

    var fName = getNthFieldName(i);

    var f = getField(fName);

    if (f.type === "text") {

//      f.alignment ="center";

        f.textSize = 6;

        f.textFont = "Helvetica";

        // Other properties go here

    }

}

The only part that didn't work was the 'center' Font type and size does which is really a great leap forward for my purposes.

Just tweak it to your liking. I found that when you specify the font, there must be no space so for example Open Sans would be OpenSans

I hope this helps someone in the near future.

Translate
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 ,
Feb 23, 2017 Feb 23, 2017

Well, if you don't want "vague" answers don't ask vague questions. The code you found works, but it only affects the file(s) you run it on.

It's by no means a "global" setting, but I'm done trying to help you. Good luck!

Translate
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 ,
Feb 23, 2017 Feb 23, 2017

It's not a vague question - it is extremely specific. The problem is with you - you didn't know the answer and your replies are complete rubbish.

The answer I found is a great time saving solution and in point of fact, is better than changing the font globally because I may want to specify different fonts for different forms.

You weren't helping at all so I am very pleased that you are 'done helping.'

Translate
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 ,
Feb 23, 2017 Feb 23, 2017

Believe me, I'm very familiar with the code above and have written similar ones, only 100 times more complicated. That's not the issue.

Anyway, this is a pointless discussion.

Translate
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
LEGEND ,
Feb 23, 2017 Feb 23, 2017

Guys play nice

Translate
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 ,
Feb 23, 2017 Feb 23, 2017

I am playing nicely - it's these experts - they can't seem to understand a simple question.

PS - If your profile picture is really you - you're in the wrong place. You should be in heaven!

Translate
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 ,
Feb 23, 2017 Feb 23, 2017

zippidi  wrote

I am playing nicely - it's these experts - they can't seem to understand a simple question.

...

May be I don't understand what you mean with "default font".

Translate
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
LEGEND ,
Feb 23, 2017 Feb 23, 2017

lol Thanks for the compliment . ACP/MVPs are encouraged to use real photos to create a friendly atmosphere for posters. You might not realise but unless 'staff' is under somebodies photo/avatar, then you are just talking to an end user like yourself and so it is important to not get too aggressive as people are doing their best to be helpful.

I don't know if the answers you received are good or bad as I was just moderating the thread, but     try67 has over 40,000 points  here -that's equivalent to having answered 4000 correct questions and Bernd 17000 points or 1700 questions. You don't get that kind of total unless you actually know your subjects.

I'll pass your compliment onto my husband next time he threatens to trade me in for a younger model

Translate
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 ,
Jan 24, 2018 Jan 24, 2018

zippidi, your obnoxious and a troll, you asked specifically about default fonts and converting from InDesign. You did not ask about changing the existing font on fields, which has no effect on the defaults. Had you done so, Try67 would have given you the code. Which by the way, the code you posted was definitely written by an expert. But instead you were rude and disrespectful to the person that was trying to help you. Why don't you not come back to this forum.

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

Translate
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
New Here ,
Aug 18, 2019 Aug 18, 2019

Hi Thom,

Would you or someone you know be able to spare that script to deal wiht my already defiened fields please? I have 740 of them in my (34-pages) from!

It would be too bad if I had to go through them one by one.

Thank you so much in advance!

Cheers,

Maddy.

Translate
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 ,
Aug 19, 2019 Aug 19, 2019

What font do you want to use?

Translate
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 ,
Aug 19, 2019 Aug 19, 2019

You can use the script at reply #4

Translate
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
New Here ,
Aug 19, 2019 Aug 19, 2019

Thank you guys for your replies!
I did tried wih the script with the font I wanted to use (Cordia New), also deleted the // in front of f.alignment so the 'centre' come in effect too, but none of these worked with my previously (existing) fields.

As someone pointed out in the post chain that it would only work for newly defined fields defined after this script put in.
I was hoping for a script that applies the font settings to all my existing fields and not so much of for future ones....

please....

Translate
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 ,
Aug 19, 2019 Aug 19, 2019

What happens when you use the script?

Translate
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
New Here ,
Aug 20, 2019 Aug 20, 2019

It sets the font default for future created fields, and not changing the font settings to the existing fields as I was hoping for it to do...

Also, Thanks for pointing out the 'centre'/'center'. I've made sure it's center.

Cordia New is what I need - whats the specific value for it, please? - though, it set the default for future-created fields correctly already with using 'CordiaNew' (without space).

So, still not working for my existing 740 fields...:(

Translate
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 ,
Aug 20, 2019 Aug 20, 2019

Create a field with this font and read the textFont entry with Javascript.

Translate
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 ,
Aug 20, 2019 Aug 20, 2019

madelannes11484240  wrote

It sets the font default for future created fields, and not changing the font settings to the existing fields as I was hoping for it to do...

For the third time in this thread, no, it doesn't do that. It ONLY edits the fields that already exist in your file.

Translate
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
New Here ,
Aug 20, 2019 Aug 20, 2019

Haha... .... for the 3rd time that I tested it and kept getting the same results... Someone in the initial chat had pointed out this script does not do what I'm looking for, hence I'm asking if anyone has the 'correct' script...

Thank you for your cuteness!!!! wonderful day.

Translate
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 ,
Aug 21, 2019 Aug 21, 2019

So for the third time I'll say that you can't change the default settings using a script. This will be my last reply on this matter.

Translate
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 ,
Aug 21, 2019 Aug 21, 2019

The posted script will change the font settings in the existing fields! Nothing more.

Translate
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 ,
Aug 20, 2019 Aug 20, 2019

Actually, it's the other way around. The code edits existing fields, not the default settings for new ones.

And it's "center", not "centre".

Also, the font name has to have a specific value, not just what you see in the drop-down list. It needs to be the internal name.

Translate
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