3 Replies Latest reply on Aug 20, 2015 7:14 AM by ll87920069

    Flatten Document with JavaScript

    ll87920069 Level 1

      Long story short I want to flatten some PDF forms using JavaScript. With a combination of AcroScript and PowerShell I have done a lot of automation that creates prefilled out forms from a CSV. I now want to combine the generated forms into a single PDF (mainly so I can end up printing out all the days generated forms at once). Setting all the fields to read only does not avoid all the fields with same name to replicate each other. For example I may have a form field labeled customerName and PDF forms for each customers John, Mary, and Sally. Then when I combine all three PDFs there are now three fields in this single document named cusomterName and each field's value will be John (instead of John, Mary, and Sally). Flattening the document is the only way I can think to avoid this. I can do this manually, but I would like to incorporate this into my AcroScripts. How do you flatten a document with AcroScript or if someone out there has another solution for my situation I'm all ears.


      I'm using Acrobat Pro XI on Windows. I cannot use any kind of cloud solutions due to strict security restrictions from my employer.


      Thanks in advance.