Danovh Posted July 16, 2014 Share Posted July 16, 2014 Hello Guys, I have a document that I put a signature in as a inline graphic so when the text returns more lines the signature will move with it. Is there a rule that can make that graphic variable based on a data field? If so, would I add all the graphics in the resources named the same as the data in the field, or just add the path of the graphics? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 16, 2014 Share Posted July 16, 2014 Hello Guys, I have a document that I put a signature in as a inline graphic so when the text returns more lines the signature will move with it. Is there a rule that can make that graphic variable based on a data field? If so, would I add all the graphics in the resources named the same as the data in the field, or just add the path of the graphics? You can do either. For instance: return Resource("MyNamedGraphicResource").content; Or: return CreateResource("filename.jpg", "graphic").content; Or using tags directly: return "<graphic resource="MyNamedGraphicResource" height=3600>"; Or: return "<graphic file=filename.jpg" height=3600>"; In the cases where you're specifying the file name, you can either specify the full path in the tag or the CreateResource call (although be careful about backslashes, which are escape characters in JavaScript), or in the Search Path box on the Advanced tab of the Composition Settings dialog. Quote Link to comment Share on other sites More sharing options...
Danovh Posted July 16, 2014 Author Share Posted July 16, 2014 Thanks for your speedy reply Dan, but I need the image to change with the name in the data, I don't see in your scripts where to put the data field it's supposed to get the name from. Am I missing something? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 16, 2014 Share Posted July 16, 2014 Thanks for your speedy reply Dan, but I need the image to change with the name in the data, I don't see in your scripts where to put the data field it's supposed to get the name from. Am I missing something? Well, I don't know what exactly is in your data. Is it the actual file names, or is it resource names, or what? If the data contains the graphic resource names, then you can do something like this: return Resource(Field("MyFieldContainingGraphicResourceNames")).content; Or this: return '<graphic resource="' + Field("MyFieldContainingGraphicResourceNames") + '" height=3600>'; If the data file contains graphic file names, then you can do something like this: return CreateResource(Field("MyFieldContainingGraphicFileNames"), "graphic").content; Or this: return '<graphic file="' + Field("MyFieldContainingGraphicFileNames") + '" height=3600>'; And again, for file names, you can either put the full paths to the graphics in the data, or in the rule, or in the Search Path box on the Advanced tab of the Composition Settings. Quote Link to comment Share on other sites More sharing options...
Danovh Posted July 17, 2014 Author Share Posted July 17, 2014 Thanks Dan, this one workedreturn Resource(Field("MyFieldContainingGraphicResourceNames")).content;Sorry for not explaining myself well. The data is sales people names & I was naming the signature graphic files the same as the names in the data & making them all the same size so I didn't need any scaling, but I will keep all the scripts you gave for future use. 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.