Jump to content

Frame color change if !Copyfit

Recommended Posts

If copy does not fit in the frame, I would like to change the color of the frame.

I cannot figure out how to do it.

In the attached file, I can change the frame color in the On Record Start, but do not know how/where to make the color change apply based on the copyfit.

What do you suggest?

fill frame red.zip

Link to comment
Share on other sites

After a brief discussion with our development team, here is how one can do it.

I recommend creating the color in the OnRecordStart rule rather than as needed so it can be shared among rules, but it would also work to do it as needed within any rule.

Just to clarify, you can indeed call “new FusionProColor” to create a color. The signature is:

new FusionProColor(name [,cyan] [,magenta] [,yellow] [,black] [,isSpot])

Where the CYMK values are percentages. You can find this in the Building Blocks dialog, on the Objects tab, under the “Resources” node.

An example is:

new FusionProColor("Brown", 0, 3, 5, 62);

FindTextFrame("Title").fillColorName = "Brown";

Also, you don’t need to explicitly add the new color to the FusionPro.Colors object; simply calling “new FusionProColor” adds the named color to the list automatically. Note also that you can’t change the values of existing colors defined in the Colors dialog.

The feature was first added to FP 8.1. Using the data below in the OnRecordStart Rule, we can create new colors and apply them to frames in the job or inside text without changing the template.

FusionPro.Colors["Fleshtone"] = new FusionProColor("Fleshtone",10,20,30,40,false);

FusionPro.Colors["Zentone"] = new FusionProColor("Zentone",100,50,25,10,false);

FusionPro.Colors["Ultraviolet"] = new FusionProColor("Ultraviolet",45,90,0,0,false);

The parameters to the FusionProColor constructor are the color name, C, M, Y, K components and the last parameter is a flag whether or not it is a spot color.

Hopefully that helps.

Edited by Alex Marshall
Link to comment
Share on other sites

Unfortunately, by the time the OnCopyfit callback rule is invoked, the border and fill colors of the frame are already set, and they can't be changed. So you can't do it that way.


However, there is a way to accomplish what you want. Create another frame, filled with Red or whatever you want, and place it behind the frame you're copyfitting, and name it something like "Background Frame". Then you can add this line to the OnCopyfit rule to hide the background frame when the text fits, and therefore to show it only when the text doesn't fit:

FindTextFrame("Background Frame").suppress = FusionPro.Composition.CurrentFlow.fits;

Link to comment
Share on other sites

  • 4 months later...



I have a "similar-but-not-quite" question as to this...instead of using a copyfitting function on a text box (the customer does not want the leading or the font to change size of the letter) I need to link to a second box on the back of the page. That part is simple by using the link text frame button presented in the tools. However a variable disclaimer is the last paragraph of the letter being composed. The customer requires the disclaimer to be printed on the front page as well as the back when and only when the text flows from a single page to a second page, it is only to be listed once on the front page if the document fits within the one page.


In not really able to use a textMeasure function since I'm not really copyfitting anything within the box. Or is there a special case of the copyfit function when it is used in conjunction with a link feature between two boxes?


In short...when everything fits on one page only use the disclaimer from the letter paragraph...if letter flows to a second page via the "link text box" function (not using an overflow page) then the disclaimer is displayed on the back from the composed letter and a new text box is "unsuppressed" to show the disclaimer on the front page.


Any thoughts or suggestions? I hope!


Link to comment
Share on other sites

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.

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...