Solved

Set form field text size to maximum in Acrobat

Posted on 2010-11-19
8
1,595 Views
Last Modified: 2012-05-10
Hello,

basically I want a form field that's text size is auto but the maximum size is e.g. 10pt. I know that the initial size depends on the height of the text field, but shrinking the fields height is not an option for me. Of course I would prefer a solution via GUI but javascript is also ok. My idea was to set the initial text size to 10pt and then in keystroke event set the size to 0, which means "auto" in acrobat; but I don't know how to validate the text width against field's rectangle width.

Thank you.
0
Comment
Question by:Stephan_Schrandt
  • 4
  • 4
8 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 34180203
Do I understand this correctly? You want the text field to use 10pt text until the string gets too long for the field, and then switch to auto?
0
 
LVL 9

Author Comment

by:Stephan_Schrandt
ID: 34180269
Yes, exactly. I know about the fieldFull event but when I use it and the user deletes some text, the text size remains 'auto'.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 34180346
The fieldFull event would have been my suggestion - with the caveat that it does not work correctly if the user deletes text or copy&pastes text.
Unfortunately the fieldFull even is only triggered on a keystroke, so we cannot just set the font size to a fixed size and see if the field fills up.
So it looks like what you want to accomplish is not possible with AcroForm fields. Sorry.
0
 
LVL 9

Author Comment

by:Stephan_Schrandt
ID: 34200485
I wonder if there may be a way to dynamically create a non-visible field, set its size to "expand to fit" and fill it with the content of the desired field. This would help me to determine the width of the original field and check if it should be 10pt or autosize. Yes you are right, I'm already in LiveCyle Designer...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 34200512
The problem again is that we can only test for the field full condition on a keyboard event, your invisible field would not be able to receive such events.
0
 
LVL 9

Author Comment

by:Stephan_Schrandt
ID: 34203115
The idea was, to create this field on every keystroke, check it's width, compare it with the width of the original field and if it it wider, then adjust the textsize of original field to auto. I will try a bit with that and give feedback. But I think even if I reach my goal with that, it produces too much overhead. At this point it's only a question of possibility =)
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 34204832
Good luck. Let me know if it works.
0
 
LVL 9

Author Comment

by:Stephan_Schrandt
ID: 34215029
Ok here's the summary.

I tried to use AcroForms. I used keystroke and fieldFull event to check if the textsize is set to auto. But this does not do the job since we don't have an event to rollback the size if needed (e.g. on text deletion).

Then I read about the "expand to fit" property of LiveCycle designer. So the idea was to use XFA to access a hidden field with expandtofit = true and copy the visible field's text in hidden fields change event , then compare the widths of both and set textSize to auto if the hidden field is larger. But, wow what a surprise, the expandtofit property isn't really a property. It's just like textSize auto. When you  mark it in the designer, internally the field.w property is set to 0. So no chance to get the displayed width in javascript.

At that point I gave up and I really think, khkremer gave the right answer in his second comment. It's just not possible.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now