Jump to content

pull variable graphics directly from a folder?


allison

Recommended Posts

I'm doing a VDP post card. 1 of the variables is going to be an image of a previously printed job that shows up on the front of the post card.

 

I'm going to have a field in my data definition that is called JobNumber. The corresponding graphic for that record entry will be named JobNumber.pdf and I will create a rule that basically says, Return Graphic Field="JobNumber" + .pdf.

 

My real question is...do I have to add ALL these files as graphic resources in my VDP template or can I pull them directly from a folder on my hard drive? And how do I write that in a javascript rule?

 

Thanks!

Using a PC, Acrobat 8, FusionPro 5.1.

Link to comment
Share on other sites

Allison,

 

You can pull graphics from any place on your computer, or even from a server, as long as you have the correct "folder and/or file address" for it. If they are all coming from the same master folder then you can use the "Search Path" definition within the Composition>Advanced panel. You would put the folder location there (i.e. c:\myData\myMasterPhotos\) and anything that FusionPro looks for as a resource it will look in the Search Path location if the resource is not defined within the template or located in the same folder as the template. Then you could use something like...

 

var varPicName = Field("JobNumber") + "_" + Field("FileName");

var varPic = new FusionProResource(varPicName, "graphic", true);

if (varPic.exists) {

...return varPic;

}

else {

...return NullResource();

}

 

Another possibility for pulling resources from multiple folder locations is to put that folder location as part of your data file. You could use something like...

 

var varPicName = Field("filePath") + Field("JobNbr") + "_" + Field("FileName");

var varPic = new FusionProResource(varPicName, "graphic", true);

if (varPic.exists) {

...return varPic;

}

else {

...return NullResource();

}

 

 

Then in your data file you would include fields for the file location and the elements that make up the specific file name. In these rules, if FusionPro doesn't find the appropriate file in the specified location it return a blank space. You could either print out a prompt to the .msg file stating what graphic could not be found, or maybe put a default "file not found" graphic in the print run instead. Either way, you would have some type of prompt telling you that a graphic wasn't found.

 

Good Luck.

Link to comment
Share on other sites

  • 3 weeks later...

Archived

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

×
×
  • Create New...