Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Adding/Deleting Attachments

Avatar

Level 3

Is there a script or feature with a button or something that the user can add attachments to a PDF form just using Adobe Reader??  Thanks for any help on this.

1 Accepted Solution

Avatar

Correct answer by
Level 10

This is the script on the Add File button:

var myDoc = event.target;

var sFile = "myFile" + NumericField1.rawValue;

myDoc.importDataObject({cName: sFile});

var myDataObject = myDoc.getDataObject(sFile);

var sFileName = myDataObject.path;

ListBox1.addItem(sFileName,sFile);

NumericField1.rawValue = NumericField1.rawValue + 1;

You'll really need to look at it in Designer though to see how everything works.

View solution in original post

6 Replies

Avatar

Level 10

There's a sample form here with scripts: http://forums.adobe.com/message/1923918#1923918

(link doesn't seem to be going direct to the message - it's message number 271)

Note that Reader needs to be extended via the Reader Extensions server for file attaching to work.

Avatar

Level 3

Thanks for your reply.  The issue is I don't have LiveCycle on this computer so I'm having trouble reading the script for the button.  Is there a way you could email or post just the script to me.  Thanks!

Avatar

Correct answer by
Level 10

This is the script on the Add File button:

var myDoc = event.target;

var sFile = "myFile" + NumericField1.rawValue;

myDoc.importDataObject({cName: sFile});

var myDataObject = myDoc.getDataObject(sFile);

var sFileName = myDataObject.path;

ListBox1.addItem(sFileName,sFile);

NumericField1.rawValue = NumericField1.rawValue + 1;

You'll really need to look at it in Designer though to see how everything works.

Avatar

Level 3

Okay I typed in the script for the button.  Is a window suppose to pop-up?  Sorry I'm somewhat new at this scripting thing for Designer. 

Avatar

Level 3

Thank you, thank you I finally figured it out.

Avatar

Level 10

Hi Catherine, glad you got it. Sorry I didn't get back to you I've been sick for the last few days.