Jump to content

Photos pulling from 1 folder


Recommended Posts

I have a template that uses a rule to insert a photo and it works great. My problem starts when I create a new template that needs to use the same photos as the other one. Do I put the new template in the same folder as the first one or is there a way to have a folder of photos only and have a rule look for the folder? If that's the case how does that work? How does the rule find the folder??

 

Here is the rule I have now.

 

AgentPhoto = CreateResource(Field("AgentPhoto"), "graphic", true);

if (AgentPhoto.exists)

return AgentPhoto;

else return NullResource();

return CreateResource(Field("AgentPhoto"));

Link to comment
Share on other sites

Specify the path to the resources in the Search Path box on the Advanced tab of the Composition Settings dialog, and any resources in that path will be found. If there's more than one path, you can use semicolons to delimit them.

 

Or, you can specify the full path in that call to CreateResource, something like this:

AgentPhoto = CreateResource("c:/some folder path/some subpath/" + Field("AgentPhoto"), "graphic", true);

But I recommend using the Search Path, to avoid gotchas with file paths and slashes in JavaScript.

 

By the way, the last line of your rule as posted will never be reached.

Link to comment
Share on other sites

I think I may have this figured out. My path was not correct.

I have it in there both ways. Advanced Tab and in a separate rule.

Here is my rule with the path. Just want an opinion if this looks correct or if there are any potential problems.

 

AgentPhoto = CreateResource("/Volumes/MACData/Printing/XServe Files/Volume_1/Untitled4/2000-9999 Forms/3008-C Personalized Checking Bank Brochures/" + Field("AgentPhoto"), "graphic", true);

if (AgentPhoto.exists)

return AgentPhoto;

else return NullResource();

 

 

Thanks for all you do.

 

Chris

Link to comment
Share on other sites

Ok. If I use the search path will the photos show up on my template on the screen??

I'm not sure what you mean. If you're doing a Preview there in Acrobat, and you're calling out the rule in a Graphic frame, then, if the graphic is found properly, it should show up. However, Preview is not a very good way to troubleshoot these kinds of things. You should do a regular composition (not a Preview), and then view the log file. That contains specific information about what resources are not found, and other hints that should be able to help you figure out why something is not appearing the way you expect in the output. If you're only doing Previews, there's a lot of guesswork.

I've been trying to put in the search path on the advanced Tab and no photos are showing up in the output file. Is there a way to browse to the folder I need?? Which slashes do I use?? I am working on a MAC.

Chris

On a Mac, you should use a POSIX path, with forward slashes. It's the same path that shows up if you do a "Get Info" on the folder in the Finder.

 

I could have answered more specifically what kind of path you need for Mac if you had mentioned you were on a Mac earlier. This is why I recommend specifying the exact versions of your OS, FusionPro, and Acrobat. I'm not very good at guessing.

I think I may have this figured out. My path was not correct.

I have it in there both ways. Advanced Tab and in a separate rule.

Here is my rule with the path. Just want an opinion if this looks correct or if there are any potential problems.

 

AgentPhoto = CreateResource("/Volumes/MACData/Printing/XServe Files/Volume_1/Untitled4/2000-9999 Forms/3008-C Personalized Checking Bank Brochures/" + Field("AgentPhoto"), "graphic", true);

if (AgentPhoto.exists)

return AgentPhoto;

else return NullResource();

That looks fine, but you should be able to specify that same POSIX path in the Search Path box, without hard-coding it in your rule.

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