Combing PDF forms with identical field names while retaining unique values.

I have several PDF files of the same form that has been filled out by multiple users. I need to create a combined file of all the responses for reporting purposes. However, the forms (obviously) all have the same field names, and when I combine them the values of the first form autofill the values of the matched fields on the other forms. I need a way to combine the forms while retaining the unique field values. I thought I could write a js to rename the fields, but that isn't possible.
*EDIT: The fields need to retain editability because some contain long, scrolling text. Flattening or read-only isn't an option, not that either fixes the above problem.
Suggestions?

UPDATE:
I solved this problem, at least for my own needs. Following try67's advice in a related post, I had to delete the existing fields and create new ones with new names. Given my desired outcome, this meant collecting all of the field properties of the fields (with some variation by field type), storing it, erasing the existing fields, and using that stored information to create new, identical fields (again with some variation by field type). Since I didn't want to retain actions or javascript, this was a perfect solution. I also no longer needed the buttons to function (since I wasn't retaining their javascript), so I made them read-only. I'm listing my working code below, in case anyone else could benefit from some or all of it.
My question to the community is this: Why doesn't Adobe allow for fields to be renamed via javascript? Is it a security issue? My life would have been a lot easier the last few days if I could simply rename existing fields.
The following script is used in a Combine Files action via the Action Wizard. The PDF optimizer is also used to strip out or flatten additional items.
//This script is used to rename all the fields in a document while also removing any javascript or actions associated with those fields. Makes buttons read only without renaming.
//Function to create a random alphanumeric ID.
function makeid(n) {
    var text = "";
    var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    for( var i=1; i <=n; i++ )
        text += possible.charAt(Math.floor(Math.random() * possible.length));
    return text;
//List variables for collecting arrays of field properties.
var fieldNum = this.numFields;
var fieldNameArray = new Array();
var fieldTypeArray = new Array();
var pageNumArray = new Array();
var fieldRectArray = new Array();
var fieldValueArray = new Array();
var borderStyleArray = new Array();
var borderColorArray = new Array();
var borderThicknessArray = new Array();
var fillColorArray = new Array();
var textColorArray = new Array();
var textFontArray = new Array();
var textSizeArray = new Array();
var textAlignmentArray = new Array();
var textMultilineArray = new Array();
var checkmarkStyleArray = new Array();
var radiowidgetNumArray = new Array();
var radiowidgetRectArray = new Array();
var radiowidgetPageNumArray = new Array();
//Get the properties of all the current fields, including widgets.
for (var i = 0; i < fieldNum; i++) {
    var currentField = this.getNthFieldName(i);
    fieldNameArray[i] = makeid(5);
    fieldTypeArray[i] = this.getField(currentField).type;
    borderStyleArray[i] = this.getField(currentField).borderStyle;
    borderColorArray[i] = this.getField(currentField).strokeColor;
    borderThicknessArray[i] = this.getField(currentField).lineWidth;
    fillColorArray[i] = this.getField(currentField).fillColor;
    textColorArray[i] = this.getField(currentField).textColor;
    textFontArray[i] = this.getField(currentField).textFont;
    textSizeArray[i] = this.getField(currentField).textSize  
    if (this.getField(currentField).type == "text") {
        fieldRectArray[i] = this.getField(currentField).rect;
        pageNumArray[i] = this.getField(currentField).page;
        fieldValueArray[i] = this.getField(currentField).value;
        textAlignmentArray[i] = this.getField(currentField).alignment;
        textMultilineArray[i] = this.getField(currentField).multiline;
    if (this.getField(currentField).type == "checkbox") {
        fieldRectArray[i] = this.getField(currentField).rect;
        pageNumArray[i] = this.getField(currentField).page;
        fieldValueArray[i] = this.getField(currentField).value;
        checkmarkStyleArray[i] = this.getField(currentField).style;
    if (this.getField(currentField).type == "radiobutton") {
        checkmarkStyleArray[i] = this.getField(currentField).style;
        fieldValueArray[i] = this.getField(currentField).value;
        var n = 0;
        while (this.getField(currentField + "." + n) != null) {
            radiowidgetNumArray[n] = this.getField(currentField + "." + n).name;
            n++;
        for (x = 0; x < radiowidgetNumArray.length; x++) {
            radiowidgetRectArray[x] = this.getField(radiowidgetNumArray[x]).rect;
            radiowidgetPageNumArray[x] = this.getField(radiowidgetNumArray[x]).page;
//Delete all the current fields, except for buttons, which become read-only.
for (var i = (fieldNum - 1); i > -1; i--) {
    var currentField = this.getNthFieldName(i);
    if (this.getField(currentField).type != "button") {
        this.removeField(currentField);
    } else {
        this.getField(currentField).readonly = true;
//Using the stored arrays of field properties, generate new, identical fields.
for (var i = 0; i < fieldNum; i++) {
    if (fieldTypeArray[i] == "text") {
        var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], pageNumArray[i], fieldRectArray[i]);
        newField.value = fieldValueArray[i];
        newField.borderStyle = borderStyleArray[i];
        newField.strokeColor = borderColorArray[i];
        newField.lineWidth = borderThicknessArray[i];
        newField.fillColor = fillColorArray[i];
        newField.textColor = textColorArray[i];
        newField.textFont = textFontArray[i];
        newField.textSize = textSizeArray[i];
        newField.alignment = textAlignmentArray[i];
        newField.multiline = textMultilineArray[i];
        newField.doNotSpellCheck = true;
    if (fieldTypeArray[i] == "checkbox") {
        var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], pageNumArray[i], fieldRectArray[i]); 
        newField.value = fieldValueArray[i];
        newField.borderStyle = borderStyleArray[i];
        newField.strokeColor = borderColorArray[i];
        newField.lineWidth = borderThicknessArray[i];
        newField.fillColor = fillColorArray[i];
        newField.textColor = textColorArray[i];
        newField.textFont = textFontArray[i];
        newField.textSize = textSizeArray[i];
        newField.style = checkmarkStyleArray[i];
        newField.readonly = true;
    if (fieldTypeArray[i] == "radiobutton") {
        for (y = 0; y < radiowidgetNumArray.length; y++) {
            var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], radiowidgetPageNumArray[y], radiowidgetRectArray[y]);
            newField.value = fieldValueArray[i];
            newField.borderStyle = borderStyleArray[i];
            newField.strokeColor = borderColorArray[i];
            newField.lineWidth = borderThicknessArray[i];
            newField.fillColor = fillColorArray[i];
            newField.textColor = textColorArray[i];
            newField.textFont = textFontArray[i];
            newField.textSize = textSizeArray[i];
            newField.style = checkmarkStyleArray[i];
            newField.readonly = true;           
//End script.

Similar Messages

  • Name the PDF file with a field name

    Hi,
    I'm new to ES2 and Form creation in LiveCycle, my knowledge in scripts is very less or none i can say, if any one out there could help me out with this i'd be greateful.
    I have created a fillable PDF Form using LivecCycle ES2 and would like to know how to name the PDF file with a field value from the form when " save form " or " submit " button are clicked.
    Thanks in advance.
    Mithun.M.I

    You can save the form with name generated from a field's value, but therefore you will have to install a folder level script first and design a custom save button in your form.
    You cannot do this with the applications save or save as... buttons, and you also cannot rename a file on submit.
    Here's an example form and a folder level script. (Maybe to complicated fdr newbies)
    http://thelivecycle.blogspot.com/search/label/Save

  • Interactive pdf form with text fields. Chinese fonts

    Hi All
    We have designed an interactive pdf with text fields. We need the text fields to be in a Chinese font. I understand that this cant be done in Indesign (change the inputting font to Chinese) I have moved the file over to Acrobat Pro and used the text property to amend the font to Simsun but when we try it out the font is still in English. Any ideas on how to remedy the problem??
    Thank you in advance
    Paul

    Basically, you need to create a pdf form.
    Add a text field to your form.
    There you can choose which font your want the text to appear in.
    The trick is, when you export from InDesign, in the "Advanced Tab" — set "Subset fonts when percentage…" to 0%, so the whole font embeds.'
    I believe there's an option in Acrobat to embed the font as well, but I'm not recalling what it it.
    But that will ensure the font appears correctly.
    d

  • Generate PDF FORM with editable fields

    Hi,
    my requirement is to create a document wich has a number of fields which users can fill in. By default, these fields need to be filled in with the data from the database, but editable by the user, the rest of the document has to be non-editable. I'm looking to PDF Forms for this, but am open to other suggestions. I can't get the output to show such fields. Is it even possible?
    Spiffo

    HI,
    I have no clear at all how we define a editable field in the template.
    Besides, we need Adobe Writer to see this editable fields from the PDF generated?
    Thanks in advance.
    S.

  • Can I create a PDF form with a field for adding/changing Photos?

    Does anyone have a solution to the following problem?
    I would like to be able to make a PDF form that others in the office can use to fill in a particular inventory and model number.  (Fields, Easy)
    Then have a field where they can replace the PHOTO of the item referred to by the inventory and model number.
    Is this possible using Acrobat professional? Can the document then be saved as, or exported somehow from there?
    I know this is probabably easy to do in Word, but can a photo be changed on a PDF and saved as?
    Thanks for any help or suggestions!
    DaddyOfZed

    It will make it possible for them to select a new photo. Will you ever want to extract the photo from the form to be used elsewhere?
    In order to set this up in Acrobat, you can create a button to display the image, set its layout to something other than "Label only", and add the following JavaScript to the Mouse Up action:
    // Prompt user to select an image
    event.target.buttonImportIcon();
    For the PC users, Acrobat Standard is sufficient for this.

  • PDF form with body field wrap

    Can we create a form where the body field carries over to a second page if the first page is full?
    gbs

    It's surprisingly difficult to do well. Text fields are not able to do this automatically. You can do some things with JavaScript, but I've not seen a good seamless implementation.
    Dynamic fields created in LiveCycle Designer can be automatically expanding and flow to new pages, but Designer is not available for the Mac.
    George

  • I have created a PDF form with field but for some reason I cant type in them

    I have created a PDF form with field but for some reason I cant type in them

    May be that the text fields are read-only.

  • I have created a PDF form with multiple drop downs, all with the same drop down values. When I select a value from 1 of the drop down fields, it replicates in all of the others - which I do not want. How can I fix this?

    I have created a PDF form with multiple drop downs, all with the same drop down values. When I select a value from 1 of the drop down fields, it replicates in all of the others - which I do not want. Can I fix this?

    I'm fairly new to this, but I think it has to do with the way you have the drop downs named. Did you copy one then keep pasting it in each field? If so, that is the problem. You should rename each one with a different number: Dropdown1, Dropdown2, etc. I think that might solve the issue.

  • How to make a PDF form with expanding tabel or expanding fields, like in Word.

    How to make a PDF form with expanding tabel or expanding fields, like in Word.

    This is currently not possible in Formscentral. It is something we are working on for the future. Please stay tuned.
    Andrew Yarborough

  • Pdf form with fields ppl can type into

    I have a pdf form with fields that are not able to be typed in. How can I edit them so that ppl can type into the field?

    Hi courtneyp58664902,
    I would recommend you to follow the steps detailed on the page associated with this link (http://wwwimages.adobe.com/content/dam/Adobe/en/products/acrobat/pdfs/adobe-acrobat-xi-con vert-forms-into-fillable-pdf-c… ).
    I would recommend you to Save the pdf with reader rights enabled [ File -> 'Save as other' -> 'Reader extender PDF' ->  'Enable More tools ( includes form fill-in and save)' ].
    Please let me know if you face any challenges or need any further assistance.
    Regards,
    Rahul

  • How to open a pdf form with fdf data

    Hi all,
          I am working on a new project. In that, I have to load a PDF contract form with FDF data on Internet Explorer Window.
    I don't know how to do it. Actually I tried using this format on the URL (while loading the respective page)
    http://www.example.org/pdf_file_name.pdf#FDF=http://www.example.org/fdf_file_name.fdf
    But it opened as an empty pdf document. . Actually I need it with the fdf data.
    Can anyone know any other way to do this?
    Or is this not possible to open a pdf form with fdf data in a browser?
    Thanks in advance
    Annamalai

    @ Bernd. It still opens a text file
    Here's my FDF file sample
    %FDF-1.2
    %âãÏÓ
    1 0 obj
    <<
    /FDF << /Fields
    <</V (07/22/2009)/T (Loan_Note_Date)>><</V (22.29)/T (Loan_AnnualPercentage_Rate)>></V ()/T (Seller_ESignatureArea1_Date)>><</V (GA Dealer)/T (Seller_Signer_FullNameTitle)>><</V ()/T (ThirdParty_ESignatureArea1_Date)>>
    /F (MARSMFLZ.pdf)/ID [ <1f0b6b55f345db39e8246247138fe562><e960588530b0d06d35cd618b34d4c314>
    ]>>
    >> endobj
    trailer
    <<
    /Root 1 0 R
    >>
    %%EOF
    (I have uploaded the related pdf file before.)
    Just now I got an idea to use WScript (the code is written in javascript)
    ws = new ActiveXObject("WScript.shell");
    ws.Run('"AcroRd32.exe" "C:\\annukar\\Refi\\Refinance_Module\\Forms\\Contract.fdf"', 1, true);
    this opens my fdf document in Acrobat reader using command prompt.
    I have a doubt now, can i use some string in place of "C:\\annukar\\Refi\\Refinance_Module\\Forms\\Contract.fdf" in the above command?
    I mean something like fdf_file = "C:\\annukar\\Refi\\Refinance_Module\\Forms\\Contract.fdf"
    and replace ws.Run('"AcroRd32.exe" fdf_file,1,true). I tried it but it doesn't work Any idea's? Since the path will not remain the same always. So i need to change it

  • How to populate Adobe LiveCycle Designer generated  PDF Forms with data from Database in Windows app

    Hi
    I have a PDF template designed in Adobe LiveCycle Designer. This template has form fields which needs to be filled with data programmatically. I am using windows application in C#.Net 2005 in which I want to retrieve data from database and merge this data into PDF form in respective fields.
    How this can be achieved?
    I searched a lot & I found that we can process the XDP file generated from PDF to acheive this. I created the XDP file out of the PDF template created in designer. But I don't know how to merge data from database into that XDP file in respective fields and again convert this XDP file back to PDF programmatically. Can anybody help me ? This is urgent.
    Thanks in advance.
    Sambhaji

    Please ignore the above code.<br />The following one is correct one.<br />using System;<br />using System.Data;<br />using System.Configuration;<br />using System.Web;<br />using System.Web.Security;<br />using System.Web.UI;<br />using System.Web.UI.WebControls;<br />using System.Web.UI.WebControls.WebParts;<br />using System.Web.UI.HtmlControls;<br />using System.Text;<br />public partial class _Default : System.Web.UI.Page <br />{<br />    protected void Page_Load(object sender, EventArgs e)<br />    {<br />        Response.ContentType = "application/vnd.adobe.xdp+xml";<br />        StringBuilder responseString = new StringBuilder();<br />        responseString.Append("<?xml version='1.0' encoding='UTF-8'?>");<br />        responseString.Append("<?xfa generator='AdobeLiveCycleDesigner_V8.0' APIVersion='2.5.6290.0'?>");<br />        responseString.Append("<xdp:xdp xmlns:xdp='http://ns.adobe.com/xdp/'>");<br />        responseString.Append("<xfa:datasets xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/'>");<br />        responseString.Append("<xfa:data>");<br /><br />        responseString.Append("<form1>");<br />        responseString.Append("<TextField1>Homer</TextField1>");<br />        responseString.Append("<TextField2>Simpson</TextField2>");<br />        responseString.Append("<field name ='DropDownList1'>");<br />        responseString.Append("<items save='1'>");<br />        responseString.Append("<text>1</text>");<br />        responseString.Append("<text>2</text>");<br />        responseString.Append("<text>3</text>");<br />        responseString.Append("</items>");<br />        responseString.Append("</field>");<br /><br />        responseString.Append("</form1>");<br /><br />        responseString.Append("</xfa:data>");<br />        responseString.Append("</xfa:datasets>");<br />        responseString.Append("<pdf  href='C:\\Test.pdf' xmlns='http://ns.adobe.com/xdp/pdf/' />");<br />        responseString.Append("</xdp:xdp>");<br /><br />        Response.Write(responseString);<br />        Response.Flush();<br />        Response.End();<br />    }<br />}

  • What are the security settings to lock down a form with fillable fields and yet allow someone with Reader to fill in the fields as will as save the form and print it?

    What are the security settings to lock down a form with fillable fields and yet allow someone with Reader to fill in the fields as will as save the form and print it?

    You want to allow someone to open your document and fill out the form (in the fields you have created), but not change or edit the form, right? Here's the answer - assuming you are using Acrobat Pro and someone will be opening the PDF using at least Acrobat Reader 9 and up:
    Tools > Protection > Encrypt < Encrypt with Password
    Answer YES to change the security.
    A new window opens:
         Do NOT select Document Open (or that will require a password to open the document.)
         Select: Permissions (Check the box next to "Restrict editing and printing of the document.")
         Change the following 2 settings from the drop-down box:
              Printing Allowed: Select High Resolution
              Changes Allowed: Select Commenting, filling in form fields, and signing signature fields
              Leave selected: "Enable text access for screen reader devices for the visually impaired"
              Change Permissions Password (insert a strong password)
              Leave all other settings alone in "Options"
              OK - OK
              Re-enter the Permissions Password (the one you entered above)
              OK - OK
              Save the PDF to apply the security [notice that (SECURED0 will appear after the document title]

  • Populating a PDF form with database data

    I would love to know how (if possible) to populate an Adobe PDF form with data pulled from an Access database.
    Background
    I have a registration form already created using Adobe LiveCycle which is used by people to fill in their details.  With a built-in xml schema, the user saves the form and sends them to me.  I extract the data into an xml document which I can then import in an Access database using VBA code.
    The Need
    When it comes time to re-register, much of the original data provided by the user has not changed.  Rather than ask them to fill out the form all over again, I would like to send them their original data and they can update whichever fields they need to.  With the xml schema built into the form, I would love to turn this form into a two-way avenue for both importing and exporting data.  Is this possible?
    Any assistance in this matter would be greatly appreciated.  Please let me know if I have not provided enough information.
    Brett

    You can connect the form to the DB using anODBC connection. This functionality comes as part of Acrobat but the form must be Reader Extended by the full LiveCycle Server version of Reader Extension to allow this in Reader. In your case, if your system is the only on ethat will interact with the DB then this might be a viable solution (but you woudl have to use Acrobat). This solution woudl involve create an ODBC connection in your system then configuring the form to make use of that connection.
    Does that make sense?
    Paul

  • Looking to create editable PDF forms with drop downs and text boxes for use on a Mac computer and iPad. Which product do I need to purchase? Do not need anything fancy

    Looking to create editable PDF forms with drop downs and text boxes for use on a Mac computer and iPad. Which product do I need to purchase? Do not need anything fancy

    Basically you would need Acrobat. However, it is now also possible to create basic form fields using just the free Reader. In fact, I've been working on a tool that allows you to do it, so if you're interested in it please contact me privately.

Maybe you are looking for