mgalligar Posted January 27, 2014 Share Posted January 27, 2014 Is it possible to have 1 text box copyfit to 80% and have another text box copyfit to 30%? Something like: FindTextFrame("SmallBo***X") Copyfit(new MagnifyAttributes("text", 10, 500, 4, 200)); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 28, 2014 Share Posted January 28, 2014 Please refer to the section "I want different copyfitting values for different frames" in the FusionPro Rules Guide. Quote Link to comment Share on other sites More sharing options...
mgalligar Posted January 30, 2014 Author Share Posted January 30, 2014 (edited) Thanks, I did but the rule there does not work. I have since figured it out. Now I have a different question along these lines. The client is putting a large amount of text in the template. I have created a rule that puts a watermark warning over the entered text. This way the client can see the warning AND still see how much the text needs to be modified.Palooza_Mailer_ForTESTING.zip I have attached the template here. I have 2 text boxes Large_Box & SmallBox. Either box should trigger the warning, but only one is working. Is there something in my rule that is preventing this from working? if (!Copyfit(new MagnifyAttributes("text", 100, 100, 4, 200))) { ReportWarning("Could not fit text in flow " + FusionPro.Composition.CurrentFlow.name); FindGraphicFrame("TextOverflowWarning").SetGraphic("TextOverflowWarning.pdf") } else FindGraphicFrame("TextOverflowWarning").SetGraphic("NullResource.pdf") } Edited January 30, 2014 by mgalligar Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 31, 2014 Share Posted January 31, 2014 Thanks, I did but the rule there does not work. I have since figured it out. Now I have a different question along these lines. The client is putting a large amount of text in the template. I have created a rule that puts a watermark warning over the entered text. This way the client can see the warning AND still see how much the text needs to be modified.[ATTACH]972[/ATTACH] I have attached the template here. I have 2 text boxes Large_Box & SmallBox. Either box should trigger the warning, but only one is working. Is there something in my rule that is preventing this from working? if (!Copyfit(new MagnifyAttributes("text", 100, 100, 4, 200))) { ReportWarning("Could not fit text in flow " + FusionPro.Composition.CurrentFlow.name); FindGraphicFrame("TextOverflowWarning").SetGraphic("TextOverflowWarning.pdf") } else FindGraphicFrame("TextOverflowWarning").SetGraphic("NullResource.pdf") } That's not the way copyfitting works. The OnCopyfit function is called on per-flow basis, and thus operates on a single text flow (usually a single text frame/box, although it can be a flow made up of multiple connected frames) at a time. You can't modify one flow/frame's contents based upon another flow/frame like that, as the order in which flows/frames are composed is not something you can rely on. In other words, you can't set up dependencies between different flows; they're all basically composed independently, at different times. That said, you can certainly replace the text in the flow that's being copyfitted, and put in a warning message if it doesn't fit, with logic like this: if (!Copyfit(new MagnifyAttributes("text", 100, 100, 4, 200))) { ReportWarning("Could not fit text in flow " + FusionPro.Composition.CurrentFlow.name); FusionPro.Composition.CurrentFlow.content = '<para><color name=Red>Warning! Text does not fit here!</para>'; } Note the <para> and </para> tags required in this context. But you still can't change the contents of one frame/flow based on another flow's copyfitting. Also, you can use the FindTextFrame and FindGraphicFrame functions to change the properties and contents of any named frames, but this can only be done reliably in the OnRecordStart callback function (before any flows are composed). Finally, I'm not sure what effect you're trying to achieve with the "large box" and "small box" frames both outputting the same content. I would probably just have the "large" frame, possibly with the vertical alignment set to bottom, and have the text copyfit as necessary. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.