0 Replies Latest reply on Jun 27, 2011 2:41 PM by vzpihtv

    Adobe Livecycle: Save as Filename from Form Field Assistance

    vzpihtv

      I have Livecycle E2 and Adobe 9.0.  I am trying to have a pdf save in a desired location with a filename that originates from a field form.  So far, I have created a folder level script under C/programfiles/adobe/acrobat 9.0/acrobat/javascript/xxxxxxx.js.  Inside the .js folder level I have this so far:

       

      mySaveAs = app.trustPropagatorFunction(function(doc, path)

      {

           app.beginPriv();

               doc.saveAs(path);

           app.endPriv();

      });


      myTrustedSpecialTaskFunc = app.trustedFunction(function(doc, file_path)

      {

           // Privileged and/or non-privileged code above

           app.beginPriv();

                mySaveAs(doc, file_path);

           app.endPriv();

      });

       

      Also, I created a button on my pdf with a text field named "NAME".  I ran a javascript with mouseUp on the button with this code:

       

      // Get the field value

      var fn = getField("NAME").valueAsString;

      // Specify the folder

      var fldr = "/c/testing/";

      // Determine the full path

      var fp = fldr + fn + ".pdf";

      // Save the file

      myTrustedSpecialTaskFunc(this, fp);

       

      For some reason, the file does not save at all in that location after typing in some text in the name field and hitting the button.  Any assistance would be greatly appreciated!