Large Amount of variable images

Posted by: jadez03

Large Amount of variable images - 08/26/08 07:49 PM

We are having an issue in our shop with a perspective job for a photographer, who would need 4 unique images per sheet on a job that will entail hundreds of thousands of records.

We have been trying to work out a way to do what we need in print shop mail, but have been unable to figure it out.

I've written up a bit of pseudocode on what we would need...

Code:
  
------Declare recnum as integer, 0
[loop]
--recnum[+1]
--place 'recnum'.jpg, 'recnum'-a.jpg, 'recnum'-b.jpg, 'recnum'-c.jpg
[/loop]
Sorry for being so confusing. What we basically would need is a function that would have a variable that goes up in increments, and can place images in the document that match the variable name and count. So record 1 gets the photos named 1.jpg, 1-a.jpg, 1-b.jpg, and 1-c.jpg.

This way we can accept the photos from the client and print them on forms making sure that the correct photos go only to the correct recipients.

Thank you in advance for your help,
-Brandon
Posted by: Raphael Lalonde Lefebvre

Re: Large Amount of variable images - 08/26/08 07:56 PM

jadez03,

If I understand correctly, you don't have a database with file names already, correct?

In this case, you could always create 4 different image objects on the screen, and edit their expressions to be something like this:

Image1:
STR(RECORD_NR()) & ".jpg"

Image2:
STR(RECORD_NR()) & "-a.jpg"

Image3:
STR(RECORD_NR()) & "-b.jpg"

Image4:
STR(RECORD_NR()) & "-c.jpg"

So the first record would have 1.jpg, 1-a.jpg, 1-b.jpg and 1-c.jpg. Record 2 would have 2.jpg, 2-a.jpg, 2-b.jpg and 2-c.jpg, and so on for the other records after that.

Hope this helps.

Regards,
Rapha
Posted by: jadez03

Re: Large Amount of variable images - 08/27/08 12:45 PM

Beautiful!

Soon we will be getting a list in CSV (database) form, so how would I have that code incorporate a # from a certain field in this database? Replace RECORD_NR with @variable@?
Posted by: Raphael Lalonde Lefebvre

Re: Large Amount of variable images - 08/27/08 12:50 PM

Field names have to be put between square brackets. Since they are strings by default, you probably won't need the STR function(although you might if it considers it number).

It would looks like this:

Image1:
[FieldName] & ".jpg"

Image2:
[FieldName] & "-a.jpg"

Image3:
[FieldName] & "-b.jpg"

Image4:
[FieldName] & "-c.jpg"

If the field turns out to be number, then just use the STR function: STR([FieldName]) & ".jpg"

Regards,
Rapha
Posted by: jadez03

Re: Large Amount of variable images - 08/27/08 12:53 PM

Thank you kindly for the quick response! You have saved the day here, sir! I wish I could repay the favor smile