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

What is wrong with my Batch Processing Script to Auto Size Text for two fields in 5000+ PDFs

New Here ,
Aug 18, 2017 Aug 18, 2017

Hello!

I have 5000 + PDFs and I need to make the text size "Auto" for two specific fields in many PDFs and to save them without a prompt. I can't find the solution anywhere. I use Adobe Acrobat DC and the files I need to edit are stored locally.   Here's what I have tried. Can someone edit my script?  It is not resizing the fields and I am being prompted to save each one rather than the "Save" function happening automatically.


Here are samples of what I tried  that don't work. This gives you a clue as to how amateur I am  :-):


var f = this.getField("HHMember9-Ethnicity-5")
f.readonly = false
f.textSize = Auto
f.readonly = true


var f = this.getField("HHMember8-Ethnicity-5")
f.readonly = false
f.charLimit= 3;
f.textSize = Auto.size
f.readonly = true


I wonder if the character limit is overriding the text size, or if I am just using the wrong

TOPICS
Acrobat SDK and JavaScript , Windows
402
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

correct answers 1 Correct answer

New Here , Aug 18, 2017 Aug 18, 2017

Thank you kindly, Mr Alheit and try67. This is just what I needed!

Translate
Community Expert ,
Aug 18, 2017 Aug 18, 2017

To set the font size to Auto set it to 0, like this:

f.textSize = 0;

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 18, 2017 Aug 18, 2017

PS. There's no need to set the readonly property to false before making changes to the fields, and then back to true.

This property only affects what the user can do with the field, not what a script can do with it.

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, 2017 Aug 18, 2017
LATEST

Thank you kindly, Mr Alheit and try67. This is just what I needed!

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 18, 2017 Aug 18, 2017

At the end of the action add a save step.

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