?
Solved

Set form field text size to maximum in Acrobat

Posted on 2010-11-19
8
Medium Priority
?
1,706 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
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…
Suggested Courses

741 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