[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Set form field text size to maximum in Acrobat

Posted on 2010-11-19
8
Medium Priority
?
1,765 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Independent Software Vendors: 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

650 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