Jump to content

Output Single PDF from discontiguous records?


Recommended Posts


FusionPro Creator 13.0.2 on an M1 Mac running Monterey 12.4, and a Windows server running FusionPro Producer. Apologies for the following wall of text...

We regularly print a variable data job for a customer. The data file has tens of thousands of records. Each record has multiple fields including State, Age, and Version. The order of records is completely random.

- For proofing purposes, the customer wants a PDF for each State containing records for each unique Age and Version combination. So I would need, for example, a PDF called "NewYork_VersionA.pdf" that contains one each of the records for Age 1 year Version A, Age 2 year Version A, and so on. Currently, I am setting an empty global variable in Global with var allAgeVersion=[]. Then in OnRecordStart, I essentially:

  • Set the record to FusionPro.Composition.composeThisRecord = false
  • Create a variable called thisRecordAgeVer consisting of fields State+Age+Version
  • Check to see if allAgeVersion contains thisRecordAgeVer. If it does not, then FusionPro.Composition.composeThisRecord = true, FusionPro.Composition.OpenNewOutputFile(thisRecordAgeVer), and allAgeVersion = allAgeVersion.concat(thisRecordAgeVer);

(I can't really post the exact code, it contains a lot more than just that including some sensitive info, and it would take me longer to cleanse the code than just summarize it)

This results in a single PDF for each unique combination, for example NewYorkAge1VersionA.pdf, NewYorkAge1VersionB.pdf, NewYorkAge2VersionA.pdf, and so on. When it's done, I have a folder full of hundreds of PDFs, and I wrote an external program that then parses the filename of each PDF, and combines the PDFs from each State.

This works, but seems cumbersome, and I couldn't figure out a way for FusionPro to generate a single PDF of all unique records per State, as they are in random order and discontiguous in the original data set. I hope I explained that correctly; is there a better way? I would dearly love to avoid the second pass that parses and combines the PDFs.

- It's important that we use the same data file and production file for both proofing and production. So in Global, I set var isProof=true and in OnRecordStart, I wrap the whole thing in if(isProof) {. Then when the proofs are approved, I go into Global and set var isProof=false so it's composing all records, turn on imposition in Compose, and away we go. This works, but I would prefer some sort of interactive prompt that asks the user if we're proofing or in production that would essentially toggle the isProof variable and enable Imposition automatically. Don't think this is possible in FusionPro, but I thought I'd ask.

- This job also pulls in graphics from a folder based on a field, for example the field FrontFile has "NewYorkVerA.pdf", so it pulls that PDF from a folder and puts it in a graphic frame. The base graphics change occasionally, and of course sometimes there's a typo in the field. FusionPro apparently doesn't log an error if there's a missing graphic, is there a way to make it do that? I've seen in the forums about the CreateResource call, but this job has a dozen or so parts, each with tens of thousands of records, and I'm worried about the overhead of a CreateResource call occurring two or more times (front, back, sometimes more) for every single record. I would love to have a way for it to flat out abort the composition if there's a missing graphic, and log it.

I have a couple more questions about this job, but they're more generalized, so I'll make separate posts about those.


Thanks so much in advance for any and all comments or suggestions, please let me know if I haven't fully explained my questions.

Link to comment
Share on other sites

Thanks Douglas, but unfortunately no. The data also contains mailing info, and is presorted by our mail room before it gets to us. I probably should've mentioned that instead of saying it's random. The end result is still (frustratingly) the same. 😑

Link to comment
Share on other sites

  • 4 weeks later...

I just found out that we also have FusionPro Server as well as Creator and Producer. Is this something that can be done in FP Server? Should I repost in the FP Server forum?

(However I did figure out how to get it to abort the Composition when the artwork isn't found, using the ReportError() function.)

Thanks for any and all suggestions.

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