Jump to content

Multiple Outputs for 1 data file


Recommended Posts

Is this possible and how would I go about it?

 

I have a 3 page document. I need Fusion pro to process all the records in a data file for page 1 of the document; generate a PDF; then go back to the first record, do the same thing for page 2 and then page 3.

 

In the end I want to end up with 3 multi Page pdfs.

 

Is this something that Fusion Pro can do?

 

We are running Fusion Pro 9.2.31

 

Thank you

Link to comment
Share on other sites

It's doable. Without seeing an example of your template, I'll answer in the abstract how I would go about doing that:

 

You essentially want to run your data file three times and turn on a different page for each "run." In order to do that you'll want import your data as an external data file and store it in an array and then tell FusionPro not to use the data file it's linked to (so that you can use the array instead). To tell FP not to use the file it's linked to add this to an OnJobStart rule:

FusionPro.Composition.composeAllRecords = false;

 

Now you'll have to tell FusionPro how many times it should create a record. In your case it will be 3 times the number of records you have in your data file (to create output for each page in your document). For this example I'm going to assume you only have 10 records. So add this line to the OnJobStart rule as well:

FusionPro.Composition.endRecordNumber = 30 // 3 * 10 records

 

Then you want to import your data as an External Data File:

var exdata = new ExternalDataFileEx('/path/to/data.csv',',');

 

From here you're kind of on your own (since I don't know what your data or template looks like) but you'll basically create an array to store those values in and reference them using the CurrentRecordNumber() function.

 

Here are some good points of reference on those topics:

External Data Files

Arrays

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