ThomasLewis Posted December 18, 2013 Share Posted December 18, 2013 I have the following snippet of code in a loop in OnRecordStart where I am trying to populate many sequentially named graphic frames with FusionPro Expression images. The problem I am running into is the .SetGraphic parameter must be a resource type "graphic". How would I set an "FP Expression Image" resource so I can do this in the loop? var myPI = CreateResource(fpx_array[x], "FP Expression Image"); myPI.AddData(UntaggedDataField("first")); FindGraphicFrame("fpx-" + x).SetGraphic(myPI); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 18, 2013 Share Posted December 18, 2013 Try this: FindGraphicFrame("fpx-" + x).SetGraphic(myPI.content); Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted December 18, 2013 Author Share Posted December 18, 2013 That validates which is a nice step forward but it errors in the composition log. Composing record #1, input record 1 Graphic is not found or is not processed properly: <pimage file=ArtGallery_85009_24fpx.fpx><data>Thomas</data></pimage>. Check for file existence and that it is of the proper format. No value associated to graphic copyhole <> in record 1. The "ArtGallery_85009_24fpx.fpx" file, along with the others, is in the same directory as the template file. I also tried bringing the files into FusionPro's Resources. In the error log it lists the entire path when I do that, so I'm sure it's finding the files okay. It must be the "of the proper format" part it's having an issue with. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 18, 2013 Share Posted December 18, 2013 Ah, okay, sorry. I don't think there's a way to do that, at least not directly. The FusionProGraphicFrame.SetGraphic and FusionPro.Composition.AddGraphicVariable functions really do take only "regular" graphics, not personalized images. How many FP Expression images are you trying to use in a record? I haven't seen a many jobs with more than two or three. You might be able to rework the job to use Imposition instead. Or, you could bring in the images as inline graphics in text frames, like so: FindTextFrame("fpx-" + x).content = myPI.content;You can also set the width and/or height, just like with any other inline graphics; something like this: FindTextFrame("fpx-" + x).content = ReplaceSubstring(myPI.content, "<pimage ", "<pimage height=7200 "); Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted December 18, 2013 Author Share Posted December 18, 2013 It's a 200+ record, 26 page document with 24 expression images throughout. I was trying to avoid having to make a graphic rule for each one. I'll try your other suggestions and see if I can get them going. Replacing the tag with the size is a neat idea. Thank you for your help. Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted December 18, 2013 Author Share Posted December 18, 2013 FindTextFrame("fpx-" + x).content = ReplaceSubstring(myPI.content, "<pimage ", "<pimage height=7200 "); This is working great, thanks again! 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.