Jump to content

Variable Images - HELP!


hopkinsprinting

Recommended Posts

I have a postcard job with 500 records. Each record contains contact information and a persons photo. I have a folder of 500 images and have defined said folder as a resource in FP. The spreadsheet file given to me has a column with all the file names of the images that correspond to the person the photo should go with:

 

Column A is the file name, Column B is the persons name, Column C is the persons address, and so on...

 

In looking at a tutorial on Printable's website, it would seem that I have to link up each image based on the persons name thus repeating the linking process 500 times.

 

Understand that I am a novice at FusionPro. I have to believe there is an easier way. Is there? Perhaps I was looking at the wrong tutorial?

 

Thanks,

Jon

Link to comment
Share on other sites

As a novice, I would suggest looking into the "Insert Picture Rule" which is a graphic rule wizard that asks for the field with your graphic name as well as the search path and a default graphic. No additional, special coding skills needed assuming the file name and field data match.
Link to comment
Share on other sites

You could also add a warning in the report...

 

Pic = CreateResource(Field("AprilDSM"), "graphic", false);
if (Pic.exists)
return Pic;
else
   {
   ReportWarning("Image for " + Field("LastName") + "not found");
   }

 

But maybe that's getting a little advanced.

Link to comment
Share on other sites

You could also add a warning in the report...

 

Pic = CreateResource(Field("AprilDSM"), "graphic", false);
if (Pic.exists)
   return Pic;
else
   {
   ReportWarning("Image for " + Field("LastName") + "not found");
   }

But maybe that's getting a little advanced.

That's also unnecessary. The single-parameter call to the CreateResource function will throw an exception if the file is not found, and the message will be reported in the log (.msg) file. Also, as demonstrated by your code, you risk reporting an error about a different field than the data field you're trying to use.

Link to comment
Share on other sites

That's also unnecessary. The single-parameter call to the CreateResource function will throw an exception if the file is not found, and the message will be reported in the log (.msg) file.

True.

 

Also, as demonstrated by your code, you risk reporting an error about a different field than the data field you're trying to use.

Actually, in this case it was purposeful.

Link to comment
Share on other sites

  • 2 months later...

Thanks to all the replies! I was able to get it to work. Wow! What a time savings!!! :-) :-) :-)

 

Now I have a new question. Can the javascript be programmed such that if the image is missing for a given record, that it suppress the graphic rule altogether for the given record? The reason I ask is our customer wants a white line around the photo. If there is no photo available for the given record, I need the while line suppressed (the white line is added to the graphic frame via FP).

 

Can this be done???

 

Thanks,

Jon :-)

Link to comment
Share on other sites

I tried the referenced javascript and I get the following error when composing:

 

Sales Rep Photo, line 8: ReferenceError:FindGraphicFrame is not defined

No value associated to graphic copyhole <Sales Rep Photo> in record 43.

 

I have named the graphic frame, "Photo" and referenced it accordingly in the javascript and the rule name is named, "Sales Rep Photo".

 

Not sure what I am doing wrong???

 

Thanks,

Jon

Link to comment
Share on other sites

I tried the referenced javascript and I get the following error when composing:

 

Sales Rep Photo, line 8: ReferenceError:FindGraphicFrame is not defined

No value associated to graphic copyhole <Sales Rep Photo> in record 43.

 

I have named the graphic frame, "Photo" and referenced it accordingly in the javascript and the rule name is named, "Sales Rep Photo".

 

Not sure what I am doing wrong???

What version of FusionPro are you using? The JavaScript frame properties access is available only in FusionPro version 6.0 and later.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...