on 01-18-2013 2:21 PM
Hi Team,
My Client came up with strange requirement. i have a text field in Adobe Form which is having a limited Character length and i am filling up with SAP PO and External PO number. External PO number vary in length. As of now if the length is large than the Text Field size in Adobe Form, i am giving multiple Lines which means It will show SAP PO number above and External PO number Below.
My client wants : Adjust it in such a way that both will come in same line, and if length increase it should reduce the font size but should display in single line only.
Is it Possible to reduce font size at run time if length of characters is more?
I think its quite not possible, but still want to check with experts
Any suggestions?
Regards,
Arpit Varma
Hi Arpit,
I have some way to do this.
1. Lets say your current font size is "10". Count the max number of characters that are possible with this font size without line break. You can use the java script command String.length.
2. If the number of characters exceeds the maximum characters, then set the smaller font for that text field using the java script TextField.font.size = "8".
3. You can do this for dynamic font size depending upon the max number of characters for each font size.
Hope you got my point. Please let me know for further help.
Regards,
Mahidhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arpit,
For getting string length for external PO, use below java script code:
var len;
len = externalpo.length;
For setting font size for that externalpo test field use :
externalpo.font.size = "8";
i am taking lengths for example 20, 30 and 40 where line break is happening. Select your external PO number on layout and write the following java script:
if (len == 20)
{
this.font.size = "8";
}
else if (len == 30)
{
this.font.size = "6";
}
else if (len == 40)
{
this.font.size = "4";
}
Please let me know if u r still facing problem.
Regards,
Mahidhar.
Hello Arpit,
Could you please tell me, what was that other way. I am also facing same problem and above coding is not working. Also, I am trying to find out feasibility of dynamic font in adobe form without using java script. So, let me know is there any other way or not. Thanks.
Regards,
Bhushan Agrawal
Hi Aprit,
The solution with script is no good solution for the customers. If you have multiple characters and a very small font-size the form will not be used by the customers.
Your Customer should use 2 lines, because the print-out is maybe not readable at your script.
Hopfefully you find the correct solution,
Regards,
Jeremia Girke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arpit,
If this is really urgent you can try creating multiple forms with different fonts set and depends on the External PO number you can call the form with smaller and larger font size.
Hope this will help you as i believe this is the simplest way to achieve this.
Thanks
Dnyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.