B4Print.com

Applications => The Rest... => Topic started by: Slappy on August 30, 2019, 11:05:48 AM

Title: XMPie Create Line breaks
Post by: Slappy on August 30, 2019, 11:05:48 AM
This may be (hopefully) simple, but I doubt it. We're doing a saddle-stitched offset job where a few thousand of the first pages get a VDP imprint in a particular area, only about .375 x 4.30" and the text has to about 10 pts. I know it's easy to scale text in XMPie based on fitting, but is there any way to introduce a Line Break instead for the really long names?
Title: Re: XMPie Create Line breaks
Post by: pabney on August 30, 2019, 12:13:13 PM
It is easy enough to add a new line, knowing where to put it is the hard part. Unless there is a character identifying where the new line is to go, I know of no way to do this well.
In cases like this, we usually just turn off hyphenation and let the name break at where Indesign determines it should. Sometimes it looks ok, others not so much.
Title: Re: XMPie Create Line breaks
Post by: Donaldg on September 06, 2019, 10:06:45 PM
Hello Slappy,

XMPie has the ability to force a line break based on counting the number of characters:

For example if a text frame needs a Title and Department, count the number of total characters and if it exceeds 36, put the department on the next line. 

if(Length(|->[Title] + @{Department}) > 36)
{
    "\r" + @{Department} + "\r"
}
else
{
    @{Department}
}

Help link: https://help.xmpie.com/
Title: Re: XMPie Create Line breaks
Post by: Slappy on September 07, 2019, 11:26:12 AM
Ah, cool! I've done very little with scripting in XMPie so far but I'll try this out if the job in question becomes problematic.

I did a quick Longest Field check and think I'll get off easy this time, but I like options! Thanks~