These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Set Font to AutoShrink, but now it's too small to read

sdiaz
Registered: Jan 24 2008
Posts: 3

I started a form from Acrobat with a Word document. I inserted fields and made the default Times New Roman with a 12pt. font. Because I need the fields to automatically shrink with the information entered, I entered $.font.size = "0pt" in form calc on the fields. Yesterday it worked fine and only shrunk the long fields. Today I switched to .pdf view and when I go to type in the fields, the font size remains at "0" no matter how much info I type in. I only need the font to shrink if the info entered into the field becomes too long. How do I fix this?

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ok, first, your using LiveCycle Designer, not Acrobat to create the form. This is very important.

Text can only be AutoSized in a Dynamic LiveCycle Designer form. So make sure you save it as Dynamic. Also make sure that your script for setting the point size is in the "Initialize" event for the field.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

sdiaz
Registered: Jan 24 2008
Posts: 3
It's not working. I've tried this. I even re-imported the form directly into Livecycle so it can be saved as a dynamic form. I entered the script and when i went to .pdf view to check it, it still only enters text as a '0pt' font. It will only enter the text as the font that I entered in the script. How do I get it to start at 12 pt and shrink to what's needed to fit in the field.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is more complex. The autosize feature is not that well defined that you can have a starting size. So I think your only option is to use JavaScript to try and create the behavior you want.

I'm not exactly sure how you would go about setting this up. But you might want to play around with the "event.fullText", "field.hScrollPolicy", and "field.maxChars" properties to see if they will get you where you want to go.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

shavedhead2
Registered: Apr 1 2008
Posts: 4
Please let me know if you're able to resolve this problem.

Is there an 'Easy" way to Autosize to fit the field?? Doesn't seem like it.
Tech264
Registered: Apr 4 2008
Posts: 111
I remember encountering that same problem. The option of this.font.size = "0pt"; will not work properly in a text field. That command line works well when you have a text field with the Allow Multiple Lines checked off. What I had to do is just choose a smaller font size and tell my co-workers to keep it short and to the point. I also have the Limit to Visible Area checked off so it doesn't run off.