#1
|
|||
|
|||
![]()
I have a document that has a limited amount of space and one of the fields is an email address. I can do a copyfit, but in order to keep everything on one line, the font has to go from 9pt down to 5 on some records. (The client's domain name is stupidly long).
Is there a way to splt the email at the "@" so that when it's longer that 32 characters, it drops the "@unecessarilylongdomain.com" down to a second line? Every record has the same domain name so is there a way to trim the right 25 characters? This way jonathan.doe@unecessarilylongdomain.com would become jonathan.doe @unecessarilylongdomain.com |
#2
|
|||
|
|||
![]()
I've used this rule which uses the width of your text box and will break the email address if it doesn't fit.
// Use TextMeasure to get the length of each email var tm = new FusionProTextMeasure; var frameWidth = 2.5; // set width of the text box (in inches) tm.pointSize = "10 pt"; // set the type size tm.font = "Calibri"; // set your typeface var str = Field("email address"); // set the field to use tm.CalculateTextExtent(str); tm.useTags = false; var tmWidth = tm.textWidth; return (tmWidth < frameWidth*7200) ? str : str.replace("@unecessarilylongdomain.com", "<br>@unecessarilylongdomain.com");
__________________
FusionPro Creator v10.1.11 / FusionPro Producer / FusionPro Expression 3.2.2 / Mac OSX 10.14.6 / Acrobat Pro DC |
#3
|
|||
|
|||
![]()
D Miller
You could try something like this? I know there is a more efficient way but this should still work. if (Len(Field("Email")) >= 32) { var emailarray = Field("Email").split("@"); return emailarray[0] + '<p>' + "@" + emailarray[1]; } else return Field("Email");
__________________
FusionPro VDP Creator 10.0.26 | MacOS 10.13.4 | Acrobat DC |
#4
|
|||
|
|||
![]()
Thanks Susan. That worked great.
__________________
FusionPro VDP Creator 12.1.0 | MacOS 10.14.6 | Acrobat DC |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|