Extract PDF data - Put data back into correct PDF

I’ve extracted data from 1000 PDFs and put this data into a csv.

In the csv I have the file name, the address fields and a reference number. I have mailsorted this data to generate some mailsort info. What I want to do now is get this mailsort info and generate a mailmark barcode to put back into the correct PDF.

I am aware you can generate the mailmark barcode using the output creation. I’m just not sure how to put the correct information back into the relevant PDF.

Anyone had any experience with this?

Hey markfarwell,

In what data format is the mailsort info that you want to add to the PDF? Does it become appended to the CSV or is it a separate data file?

it’s in a csv. in the csv i have also extracted the filename as a field so i have an indicator to know what file i need to put back into.

I think what i’m going to have to do is generate a new pdf with just the mailmark barcode and then overlay this onto the original pdf.

unless there’s an easier, all in one way that doesn’t require spending 20k+ on the mailsort plugin for connect.

Based on the information you already exchanged with my colleague Stephen, you could, once you have extracted and sorted your CSV data, do the following:

  1. Set your CSV as the data input for a Datamapper

  2. Dynamically call each PDF (1 per record) and set it to be the background of your Section (see example of Control Script below)

     var activeSection = merge.template.contexts.PRINT.sections['Section 1'];
     activeSection.background.source = BackgroundResource.RESOURCE_PDF;
    
     var resourceUrl = 'file:///C:/Untitled.pdf';//This is where you set your dynamic path to your PDF
     activeSection.background.url = resourceUrl;
    
  3. In your Output Preset

  • Set your barcode
  • Make sure you check the option Pass-through PDF resources so your PDF aren’t “rebuilded”.

That should put you in the right direction.