4 Replies Latest reply on Jan 7, 2014 1:15 PM by hinckdogg

    Export Form Data As dialog box

    hinckdogg

      I have a Patient Experience survey (fillable PDF form) that a survey person uses when doing patient follow-up calls. When the survey is complete, they select Forms>Manage Form Data>Export Data... to display the Export Form Data As dialog box. They type in the Survey ID No. into the File name box from the field in the form and press Save.

       

      This is fine but I'd like this step to be more transparent to the survey person by replacing these multiple steps with a button on the form that automatically saves the form data as an FDF using the Survey ID No. as the file name.

       

      I've seen similar questions asked for using the Submit Form function but none related to what I'm trying to accomplish. Any help would greatly be appreciated.

       

      Thank you.

        • 1. Re: Export Form Data As dialog box
          George_Johnson MVP & Adobe Community Professional

          This is possible, but how you approach it depends on whether the user has Acrobat or Reader, and what version. The easiest way to do this if the user is using Acrobat is to add a script that uses the exportAsFDF JavaScript method to the button and add a certification signature. The user then has to trust the certificate to allow privileged JavaScript. The alternative is to install a folder-level JavaScript file that includes code that's a bit more complicated, but the document won't need to be certified and trusted.

          • 2. Re: Export Form Data As dialog box
            hinckdogg Level 1

            The user has Acrobat 9 Professional. How do I add a certification signature? Can you help me with the code to use the value of the Survey ID No. field as the file name?

            • 3. Re: Export Form Data As dialog box
              George_Johnson MVP & Adobe Community Professional

              The script could be as simple as:

               

              // Mouse Up script for a button

              // Document must be certified and trusted

              (function () {

               

                  // Get the field value

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

               

                  // Abort if field is empty

                  if (!fn) {

                      app.alert("The survey number field is blank. No FDF file created.", 1);

                      return;

                  }

               

                  // Set the file path and name

                  var FDF_path = "/C/Documents and Settings/George Johnson/My Documents/FDFs/" + fn + ".fdf"

               

                  // Attempt to export the FDF

                  try {

               

                      exportAsFDF({cPath: FDF_path});

                      app.alert("FDF file successfully exported: " + FDF_path, 3);

               

                  } catch (e) {

               

                      // Let the user know something's wrong

                      app.alert("Could not save FDF file: " + e.toString() + "\r\r" + FDF_path, 1);

               

                  }

               

              })();

               

              You'll have to replace "survey_number" with the actual name of the corresponding field and change the FDF_path variable to point to an existing folder on the system (both your's during testing and the user's), but you should get the idea. It doesn't check the field value to make sure it's valid for a file name, but if it's not, an error will be generated and the attempted file name will be displayed.

               

              To certify the form in Acrobat 9, select: File > Save as Certified Document

               

              and add the signature. The user will have to trust the id by showing the certificate and adding it to their list of trusted identities and trusting it for privileged JavaScript. They only have to do this once.

              • 4. Re: Export Form Data As dialog box
                hinckdogg Level 1

                Can you tell me about installing a folder-level JavaScript file so that the document won't need to be certified and trusted?