Jump to content

Test data field to previous record data field with one input file.

Rick J.

Recommended Posts

I have a project that I’m trying to figure out. What I would like to do is have a different graphic brought into the background based on my data file. If the DN number stays the same I need a specific graphic brought in for the first time that number shows up, and then a different graphic brought in for each time that same number occurs. The YN column will determine what graphic gets pulled in for the first occurrence. There is a different graphic for Y and N. The graphic that goes on each consecutive entry (as long as the DN is the same) is the same for both the first Y and N. In other words, the “G” graphic will go on any page after the first instance of a DN number regardless of whether it is a Y or N.


The pages in the output should be as follows (DN-text YN-graphic)

1 Y

1 G

1 G

1 G

2 N

2 G

3 Y

3 G

3 G

4 Y

5 N

6 Y

7 N


In OnJobStart I tried to create an external data file based on my input file and then tried to call OnJobStart from inside of onRecordStart and compare the DN fields to see if they are equal. It's not working. I just get an output exactly the same as my input file. In other words, no "G" background is coming in. I'm only getting the Y and N graphics.


Here’s my info:

FusionPro VDP Creator 0.3.36

Adobe Acrobat XI

Mac OS X Yosemite Version 10.10.5


Edited by Rick J.
forgot to attch files
Link to comment
Share on other sites

You don't need any callback rules. You only need to do this in the single "Bkg" graphic rule:

if (FieldChanged("DN"))
   return Resource("Background_" + Field("YN"));
return Resource("background_G");

Or, more succinctly:

return Resource("Background_" + (FieldChanged("DN") ? Field("YN") : "G"));

Note that this will work correctly in a composition, but not in Preview.

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.

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