Jump to content

Multiple Copyfit requirements


mgalligar

Recommended Posts

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 by mgalligar
Link to comment
Share on other sites

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.

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.

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