Jump to content

Recommended Posts

Posted

Hello hive mind,

I have a postcard where the only variable data is the mailing address block. The text frame containing the address block will have a white background and the vertical text alignment will be set to bottom. Within the data source are two columns ('Title' and 'Company' in this case). Some recipients won't have a title and/or company. Although I will enable the suppression feature to avoid blank lines, the issue is that my customer wants the white text frame to reduce in height when the Title and/or Company fields for a particular recipient is/are blank so there isn't a bunch of unused white space. As far as I know, only the height of the text frame would need to change.

Can this be done?

Thank you,
hp

Posted

On older versions of FusionPro you needed the Producer or API version to do this. On version 13+ this should work on all versions.

Basically you just need to figure out your line height or leading that you need to reduce by and then change the y and height attributes of a white frame behind the text. I would avoid resizing the address text frame itself as you may run into issues with the top lines being omitted but a line break still being present which will cause some copyfitting issues.

The following code would go into OnRecordStart.

var lineheight = 1440; //leading in hundredths
var whitebox = FindTextFrame("whitebox");
var adjustment = 0;

if (!Field("Company"))
	adjustment += lineheight;

if (!Field("Title"))
	adjustment += lineheight;

whitebox.y += adjustment;
whitebox.height -= adjustment;

I've attached an example.

variable_white_box.zip

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...