This conversation has been locked due to inactivity. Please create a new post.
This conversation has been locked due to inactivity. Please create a new post.
Hello everybody!
I'm working with SAP.
On my current project I would like to implement a customer form via Adobe Lifecycle Designer.
I'm going to ask a developer to implement the following logic:
There is a fixed rectangular area in the form. This area should represent a text.
In case of long text I would like to reduce the font size to fit the text into the area. It should look like that
Text alignment within the area is Horizontal Centered, Vertical Centered
Text wrap is on
Font is Arial, initial size is 10
Is it possible to implement?
Views
Replies
Total Likes
Hi,
Set textfield to multiline and in the font tab set the font size to "0".
Sample attached.
Niall
Thanks a lot!
It is working!
One more question how to define the default font size for such element?
I've created a test form with one textfield. Set the font size to 0 and as the result if I put only one char its initial size is about 12. But I would like to set the initial size as 10.
Best,
Sergey
Views
Replies
Total Likes
Hi,
I don't think so. Any scripting to force an initial font size, overrides the 0pt and then the text will not automatically reduce.
12pt initially or nothing, as far as I know.
Niall
Views
Replies
Total Likes
Hi Niall,
Let assume default font size is 10 then can I check in a script that text is not filled within the area and switch the font size to 0?
It would be the best variant for me.
Regards,
Sergey
Views
Replies
Total Likes
Hi Sergey,
Attached is an update - check the enter and exit events. It may work for you, but you would want to test.
Good luck,
Niall
Views
Replies
Total Likes
Hi Niall,
Is it possible within a script to check that a text string is to long to fit a textfield element?
For example there is a texfield element with autoexpand enabled. In the script remember width and height of the element, then assign a text sting and after it check new height and width. If they have changed then disable autoexpand, restore original width and height and set the font size to 0.
Or do something similar because I'm not a professional in scripting...
Best,
Sergey
Views
Replies
Total Likes
Hi,
That is what the script in the last example is trying to do. You have to be careful, because if you turn the script around, it can end up turning off the auto reduce (0pt).
In the sample I have tested against 33 characters in the textfield. If you field is smaller then you would need to adjust this up or down.
It is doing this on the enter/exit events, because it was flaky when trying it on the change event. When typing in the data, the font size should be 0pt.
If you try a few alternatives, you may get it working like you want it.
Niall
Views
Replies
Total Likes
Hi Niall
Could you post the source code from your PDF here?
I've tried several methods but I've been unsuccessful.
If I set autoexpand I cannot request width and height of a element (they are always 0 in the respective properties) the same applies for the font size property when font size is set to 0.
I do not want to program a threshold counter which will be measured in characters and set the font size to 0 if current characters count is above the threshold value because I'm using a variable width font like Arial. I consider it as the last chance decision now...
Best,
Sergey
Views
Replies
Total Likes
Hi Sergey,
Here is the form. Below is an abstract from the XML source tab, but I would not be included to start pasting this into your form - it is better to work within the Design tab.
<field name="TextField1" w="44.45mm" h="22.225mm">
<ui>
<textEdit multiLine="1">
<border>
<?templateDesigner StyleID aped3?>
<edge stroke="lowered"/>
</border>
<margin/>
</textEdit>
</ui>
<font typeface="Myriad Pro" size="0pt"/>
<margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/>
<para vAlign="middle" hAlign="center"/>
<event activity="exit" name="event__exit">
<script contentType="application/x-javascript">
if (this.rawValue.length < 33)
{
this.font.size = "10pt";
}
else
{
this.font.size = "0pt";
}
</script>
</event>
<event activity="enter" name="event__enter">
<script contentType="application/x-javascript">
this.font.size = "0pt";
</script>
</event>
</field>
Views
Replies
Total Likes
Hi Niall
this.rawValue.length < 33
I'm trying to avoid this...
Do you know a way how to check that a text cannot fit the element or check that element has been expanded?
Best,
Sergey
Views
Replies
Total Likes
OK,
This contains a second sample, where the textfield is set to 10pt and limits content to visible area:
But in this case the script is in the full event - setting the font to 0pt.
However it is not smooth - the user gets a beep when the field is full and has to exit and go back into the field to get the text to reduce in size.
This is as far as I can take it.
Hope that helps,
Niall
Unfortunately I forget to mention that in my case this field is to be read only and should be designed to represent a text string from the SAP system.
Regards,
Sergey
Views
Replies
Total Likes
Hi Sergey,
In that case, I think the only options are:
I appreciate that this is not ideal, but I really think these are your only options.
Good luck,
Niall
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies