Jason643 Posted May 10 Posted May 10 I am trying to automate gathering my resources. I can get it to work through a rule without adding the files in as resources if I use something like this: return CreateResource("File Path\\" + Field("PHOTO") + ".pdf"); This will show the resource in the preview, and it will compose just fine. This is how I want to do it, getting the file path from my data file: (slicing out the name of the date file) return CreateResource(PrimaryInputFile().slice(0,81) + "\\" + Field("PHOTO") + ".pdf"); I can run both in a text rule (without the "CreateResource" function and they both return the exact same string. Validating the rule shows that that the graphic exists, and it will show the image in the preview, but when I compose, the image isn't in the output file. Any help on why building the string with the "PrimaryInputFile()" is breaking it would be great! Thanks! Quote
ThomasLewis Posted May 10 Posted May 10 Might be an issue with your slice numbers. Give this a shot: return CreateResource(PrimaryInputFile().replace(/[^\\]*$/, "") + Field("PHOTO") + ".pdf"); Although I don't really understand why you need to specify a path if the input file is in the same folder as the resources, FusionPro can generally find them by name alone without a path. Quote
Jason643 Posted May 13 Author Posted May 13 Good to know that it can find resources in the same folder. I tried this: return CreateResource(Field("PHOTO")); It is the same result as before, when I preview the image shows up, but after I compose it is not there. Quote
ThomasLewis Posted May 13 Posted May 13 Are you composing using Producer/Server? If so, the path will change to your working folder. You might try using FusionPro.inputFileName instead of PrimaryInputFile() Quote
Jason643 Posted May 13 Author Posted May 13 You are right, it looks like the path is changing. I tried FusionPro.inputFileName and the path changed for that as well. Is there a way to preserve the original file path in a variable that I can reference after I send it off to be composed? Quote
ThomasLewis Posted May 13 Posted May 13 FusionPro.inputFileName does preserve the original path. It should be whatever it was when you imported the data file and match whatever is listed in the def file in the working folder. Problem is we still have no idea what your composition setup is since you haven't disclosed any information. You are probably capturing a local path your server can't resolve. It needs to be changed to a UNC path that the account the server is running under has access to. Assuming part of the path is right, you would need to change the root part of the path and preserve the rest and/or make sure the service account has access to it. Quote
Dan Korn Posted May 13 Posted May 13 It's still not clear whether you're composing with Producer or Server or some other system. That said, I would add the UNC path to the graphics in the Search Path box on the Advanced tab of the Composition Settings dialog. You'll need to make sure that the user account under which the composition is occurring (set up in the Producer Configuration app for Producer) has read access to the UNC share. Alternatively, you (or your IT person who sets up Producer) can add search paths to queues in the Producer Configuration app, on the Scheduler machine. Quote
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.