Quantcast
Channel: Adobe Community: Message List - PDF Forms
Viewing all articles
Browse latest Browse all 57214

Re: problem viewing data in forms completed on Macs

$
0
0

Here is your solution.  Copy the Javascript code below from // to //   Then open Windows Notepad program and past the script in there.  After you paste it go to "save as"  then look for the Javascript folder for Adobe Pro X ( or XI)

 

It will probably located in some place like  C:\Program Files\Adobe\Acrobat 10.0\Acrobat\Javascripts.

 

And then name the file whatever  (for example FormFill.JS)  - the .js is important.    Your done.  Then open Adobe Pro and click on the FILE button inr the up right corrner.  On the gray drop down menu and new words FIX FILE APPEARANCE should be on the bottom of that drop down.   If you get a Mac submission, click these words (button) and it will fill in the info.  (I don't lay claim to the solution or coding)  But it work in Adobe Pro X  & XI and have done it for the whole staff in my department

 

// Add a menu item to the end of the File menu

  1. app.addMenuItem({

    cName: "AS_correctFieldAppearances",

    cUser: "Fix Field Appearances",

    cParent: "File",

    cExec: "COM_ACROSCRIPT.correctFieldAppearances(this);",

    cEnable: "event.rc = (app.doc && numFields && (typeof xfa === \"undefined\"));"

});

 

// Create namespace to prevent potential name conflicts

var COM_ACROSCRIPT = {};

 

// This function does the work

COM_ACROSCRIPT.correctFieldAppearances = function (doc) {

 

    var i, j,

    f_name, f, fp, nWidgets, fw, cc,

    c1 = color.blue, c2 = color.yellow;  // These can be any color, as long as they are different

 

    // Suspend redrawing field appearances until the end of this script

    doc.delay = true;

 

    // Loop through all of the fields in the document

    for (i = 0; i < doc.numFields; i += 1) {

 

        // Get the name of the current field

        f_name = doc.getNthFieldName(i);

 

        // Get a reference to the current field

        f = doc.getField(f_name);

 

        switch (f.type) {

 

        case "button"    : break;  // No need to process buttons

        case "signature" : break;  // Digital signatures will not be present if saved with Preview

 

        default :  // text, checkbox, radiobutton, combobox, listbox

 

            // Get the page numbers on which the current field's widgets reside

            // typeof = number (for single widget) or object (array, more than one widget with the same name)

            fp = doc.getField(f_name).page;

 

            // Determine the number of widgets for the current field

            nWidgets = (typeof fp === "number") ? 1 : fp.length;

 

            // Loop through the current field's widgets

            for (j = 0; j < nWidgets; j += 1) {

 

                // Get a reference to the current widget

                fw = doc.getField(f_name + "." + j);

 

                // Save the current widget's border color

                cc = fw.strokeColor;

 

                // Set the current widget's stroke color to a temporary color,

                // either c1 or c2. Choose c2 if the current color equals c1

                fw.strokeColor = color.equal(cc, c1) ? c2 : c1;

 

                // Set the widget stroke color back to the original border color

                fw.strokeColor = cc;

            }

 

            break;

        }

    }

 

    // Allow Acrobat/Reader to redraw the field appearances

    doc.delay = false;

 

    app.alert("All fields have been processed.", 3, 0);

}  //


Viewing all articles
Browse latest Browse all 57214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>