How to get visible text length from text field and cut off extra characters?

Avatar

Avatar

linsus

Avatar

linsus

linsus

08-02-2019

I've been trying to solve this problem for two days now with no luck. I'm newbie in this world. I'm using ADOBE LIFECYCLE DESIGNER ES4 for SAP.

My problem is that I have small price tags that I want to print to one A4 size paper. 2x5 labels in two rows. I have values coming from database and I print several sheets.

It actually doesn't matter what happens before the form but the problem is that some of the database values are like 1080 characters long but size of text field is smaller. Only visible area of the text field should be printed to output PDF and all text should end with character "+".

If this "+" doesn't show I know that the actual data is too long and I should get some sort of info that all my text didn't fit in to this area without going through all printed labels. All characters outside the visible area should be cut off completely so I can check if text printed on label is ended with "+".

I can't just cut off text after f.ex. 255 chars because chars are different sizes and the amount of visible chars may vary.

I have allowed multiple lines and limited length to visible area and hoped that the useless part of text would be cut off but if I read data from my script then I get the whole text and I don't know if it fitted to visible part of the text box.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

radzmar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

385

Correct Answer

485

Avatar

radzmar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

385

Correct Answer

485
radzmar
MVP

17-02-2019

You can't determine by scriptings if a fields value is too large for the fields visible area. There is simply no property in the field widget available that will inform you when this happens. The only information is the visible plus sign [+] in the fields corner. 

The available methods (such as "limit to visible area") to prevent of too long data to being entered are only working for inputs done by a user BUT NOT when done by scriptings or data loadings by the PDF viewer.

Answers (0)