Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

adding attachments to a dynamic form

LeeH1978
Level 2
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

0 Replies
radzmar
Level 10
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.

LeeH1978
Level 2
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

LeeH1978
Level 2
Level 2

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

yodadobe
Level 6
Level 6

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;

                    }

          }

}