Jump to content

Need help for inserting variable graphics in text


gschoeman

Recommended Posts

I have a graphic variable placement question/issue...

 

This job requires a customer to be allowed to select anywhere from 0 to a maximum of 3 graphic logos from a list of 5 and then place those graphics right justified next to a photo. If they choose only 1 logo then that would be next to the photo and if there are 3 logos they

 

I believe the only way to do this is to create a graphic switch rule that returns tagged text and then place that rule in a FusionPro text box. I am not sure if I need to use the CreateResource function in the rule or if I need to add each logo as an individual Resource in the Create Resources area.

 

I have tried a variety of test rules but keep getting errors... any help or hints would be greatly appreciated. :rolleyes:

Link to comment
Share on other sites

This job requires a customer to be allowed to select anywhere from 0 to a maximum of 3 graphic logos from a list of 5 and then place those graphics right justified next to a photo.

Select how? Can they browse for a file? How does their selection get reflected in the input data file for the composition?

If they choose only 1 logo then that would be next to the photo and if there are 3 logos they

They what?

I believe the only way to do this is to create a graphic switch rule that returns tagged text and then place that rule in a FusionPro text box. I am not sure if I need to use the CreateResource function in the rule or if I need to add each logo as an individual Resource in the Create Resources area.

You want a text rule, not a graphic rule; however, the rule will need to return tags representing inline graphics. If you're returning multiple graphics, then a switch rule probably won't help anyway. And if you call the CreateResource function, then you can reference the graphics by file name without having to add them as resources.

 

Assuming that the input data contains the names of the graphic files, you should be able to do something like this (I'm completely speculating on the field and graphic names):

var result = "";
for (var i = 1; i <= 3; i++)
{
 var FieldName = "Graphic" + i;
 if (Field(FieldName))
   result += CreateResource(Field(FieldName), "graphic", true).content;
}
return result;

I have tried a variety of test rules but keep getting errors... any help or hints would be greatly appreciated. :rolleyes:

Can you post an example of what you've already tried? Or at least give us some idea of the names of the graphics, or the fields in your data?

Link to comment
Share on other sites

Dan,

 

Sorry, here is the missing info...

 

The customer will have a multiple pick list of 5 logos of which they can select up to 3. But the logos have to appear right justified next to a photo whether there is none, one or three selected. Hence the assumption of the text rule returning graphics as I have seen referenced elsewhere but do not have any experience in creating. I will see if I can take your suggested solution and make it work.

 

Thanks for the help!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...