Expand my Community achievements bar.

Attach files to a pdf with Adobe LiveCyle Designer 7.1

Avatar

Former Community Member
Hi, I need to add a button to a form so that it allows me to attach archives to the pdf, somebody knows if this is possible and in that case since it becomes?
3 Replies

Avatar

Level 5
In my case I have a drop-down list of files with preloaded filenames to attach. Here is the code that works for me on a click of button.



var selectFileName = form1.subform.DropDownList1.rawValue;

if (selectFileName != "Please Select") {

var doc = event.target;

doc.importDataObject(selectFileName);

var MyPar1 = doc.getDataObject(selectFileName);

var filename = MyPar1.path;

}



After you click the button it open a windows dialog box asking you to choose the file and adds the attachment to the attachment pane in runtime. To view the attachments simply view the attachment pane in runtime after you add the attachments.



Good luck,

SekharN

Avatar

Former Community Member
I put it himself code that you in it himself type of field and when I give click him throws east message to me:



NotAllowedError: Security settings prevent access to this property or method.



somebody can help me?



PD: I need to run it in adobe reader 8

Avatar

Level 5
Sorry I forgot to mention you need to turn on User privileges using Reader Extensions. The privilege that you need to add through Reader Extensions is 'Addition of and changes to embedded files'.



Regards,

SekharN.