Jump to content

Output a reference text file along with the PDF


mjlongo

Recommended Posts

Hello,

 

 

We have a need to be able to create a reference csv file that would be output preferably at the same time our FusionPro file composed. Can this be done?

 

We would be creating a final PDF with anywhere from as little as 200 to as many as over 200,000 single page files whereby each page would contain data related to a UserID. Our mailing/inserting equipment sources this PDF for printing data inline as it inserts items into envelopes, etc. We need a "lookup" csv file that would state that UserID is page XX in the PDF. As the mailing/inserting machine is running it would then know that when it scanned the barcode for a UserID, the lookup file would tell the machine that it has to print page XX of the PDF.

 

Any assistance would be appreciated.

 

Thanks!

-Mike

Link to comment
Share on other sites

I just wanted to follow-up that yes, we can create something that works with how the data was initially read into FusionPro but we want more of an assurance that page numbers are in sync with the user. We cannot afford any missed pages, etc.

Thanks!

Link to comment
Share on other sites

There's no capability to output a CSV file. However, you can output an XML log file which has information about each output record, the number of pages in it, and any arbitrary data you want.

 

In OnJobStart, just call FusionPro.Composition.CreateXMLLogFile(). This will create an XML file for the job. You can specify a file name if you want; if not, ".xml" is appended to the main log file name. (In a FusionPro Server job, you can set the CFG file setting "XMLLogFile".)

 

In OnRecordStart, you can call FusionPro.Composition.LogXMLMetadata() with a key and a value, something like this:

FusionPro.Composition.LogXMLMetadata("UserID", Field("UserID"));

And the data will appear for each record in the XML file.

 

That said, it's my understanding that, instead of generating a secondary output file, the usual way to track printed pages in a job like this is to put a barcode on each page, encoding something like "Record X, Page Y of Z". You probably want the UserID instead of the record number.

Link to comment
Share on other sites

Dan,

I had forgotten about the XML file and got it working fine for the UserID. The XML solution would work fine for us as we could re-format the XML into a simple csv file.

 

However, I cannot seem to log the page number of the job. I'm sure my issue is nothing more than using the proper command. I tried this within the OnRecordStart:

 

 

 

 

var pgnum = FusionPro.Composition.currentPageNumber;

FusionPro.Composition.LogXMLMetadata('MPID',Field("MPID")); //WORKS
FusionPro.Composition.LogXMLMetadata('PageNum',pgnum); //DOESNT WORK

Link to comment
Share on other sites

I had forgotten about the XML file and got it working fine for the UserID. The XML solution would work fine for us as we could re-format the XML into a simple csv file.

That sounds like a good solution.

However, I cannot seem to log the page number of the job. I'm sure my issue is nothing more than using the proper command.

Yeah, that's because the logging is per-record, not per-page.

 

But since you have one page per record, you could also just output the record number:

FusionPro.Composition.LogXMLMetadata('PageNum', FusionPro.Composition.outputRecordNumber);

Or, you could just keep a counter when you're parsing the XML and write out that number to each line in the CSV.

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