Expand my Community achievements bar.

adding attachments to a dynamic form

Avatar

Level 2

Hi there,

I am creating a dynamic PDF form and I would like users to be able to attach a file (e.g. a word file, photos) to the dynamic form.

Once the form is completed and returned (in PDF format) I want the person reviewing the form to be able to open the embedded attachments.

If this possible?

Many thanks for you help in advance

Lee

5 Replies

Avatar

Level 10

Yes, BUT - yes, there is a big but - only if you have LiveCycle Reader Extensions to the hand.

This server solution is required to enable the neccessary rights to a form, so users with Adobe Reader can add attachments to dynamic forms.

Otherwise it's only possible for users with Acrobat to attach files.

Avatar

Level 2

Hi Radzmar,

Many thanks for your answer. I do have the reader extensions in LiveCycle designed. Do you have any guidelines on how to add areas to a form for users to add attachments?

Thanks

Lee

Avatar

Level 10

What do you mean with "areas"?

Avatar

Level 2

sorry, I mean do you have any guidelines on how to add attachments to a dynamic form?

Avatar

Former Community Member

The user can add attachments by clicking the paper clip icon.

If you mean you want to add attachments through script or associated with a form field, below is an example where a form check box triggers adding an attachment. It adds an attachment with a description pulled from the caption of the check box. My check box captions end in : which is stripped.

//Change event of check box

{variable object in Heirarchy}.attachmentCheck(this, event.target);

//code in variable object

function attachmentCheck(checkField, myDoc) {

          var descrip = checkField.parent.nodes.item(0).value.resolveNode("#text").value;

          descrip = descrip.substr(0, descrip.length - 1);

          //app.alert("\"" + descrip + "\"");

          if (checkField.rawValue == "1"){

                    var cancel = true;

                    myDoc.importDataObject(descrip);

                    try {

                              var objDoc = myDoc.getDataObject(descrip);

                              objDoc.description = descrip;

                              cancel = false;

                    } catch (e) {}

                    if (cancel){

                              checkField.rawValue = 0;

                    }

          } else {

                    mBoxResult = xfa.host.messageBox("Unchecking will delete the attachment.", "Confirmation", 2, 1);

            if (mBoxResult == 1) {

                              var obj = myDoc.dataObjects;

                              for (var i = 0; i < obj.length; i++){

                                        //app.alert("\"" + obj[i].description + "\"");

                                        if (obj[i].description == descrip) {

                                                  //app.alert(obj[i].name);

                                                  myDoc.removeDataObject(obj[i].name);

                                        }

                              }

            } else {

                              checkField.rawValue = 1;

                    }

          }

}