Solved

Set form field text size to maximum in Acrobat

Posted on 2010-11-19
8
1,643 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Silverlight ERP To Angularjs,HTML5 3 58
Jquery 7 33
How do I Enable submit button only if listbox has items 4 32
Slush on text 2 11
PDF files have been in the limelight due to its unmatched features.  Personal documents, emails, business reports and eBooks are all converted into PDF files owing to peerless features provided by it. Adding watermark to a PDF file is a method to se…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

749 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