Skip to main content
Participant
August 18, 2017
Answered

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

  • August 18, 2017
  • 2 replies
  • 447 views

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

This topic has been closed for replies.
Correct answer HousingWorks

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

2 replies

Bernd Alheit
Community Expert
Community Expert
August 18, 2017

At the end of the action add a save step.

try67
Community Expert
Community Expert
August 18, 2017

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

f.textSize = 0;

try67
Community Expert
Community Expert
August 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.

HousingWorksAuthorCorrect answer
Participant
August 18, 2017

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