Expand my Community achievements bar.

Adding/Removing Attachments with JavaScript and the Attachments Tab

Avatar

Former Community Member
I have a form with an attachments section. You can add and remove attachements by clicking on buttons which use JavaScript to attach the files to the PDF. When you add an attachment, a subform appears with the name of the file you have attached and a textfield for you to enter a description of the file.



All of this works fine as long as the user uses the form to add and remove attachments and not the attachments tab in acrobat/reader. They can add a number of files using the forms "Add Attachment" button and then go and delete them using the attachments tab in acrobat and the form will still list these attachments even though they've been removed.



Is there any way of detecting when a user adds or removes an attachment using the attachments tab in acrobat?
8 Replies

Avatar

Former Community Member
Are you able to do this with a dynamic form? I have been unable to make attachments work in a dynamic form created with LCD 8.



Carl Young

Avatar

Level 7
And a data object is not an annotation attachment. They are properties of different JS objects. An "attachment" item is a property type of an annotation,while the "data object" is an item property of the document object. One can not process the contents of the attachment with JavaScript, while the data object can be created adhoc and be used to hold data for use in form fields. An attachment has an icon associated with it and is located at a specific location within the PDF and appears on the "Comment" tab, while a data object is not seen by the end user.

Avatar

Former Community Member
I am wondering if anyone else has come across this limitation. When you use Jimmy Pham's script in a dynamic form enabled in Acrobat Pro, no attachments are allowed when the form runs in Reader 8. I was quite surprised by this. Same with using app.execMenuItem("AddFileAttachment");



It appears that ARES will add rights to add attachments to dynamic forms, but not Acrobat Pro.



Carl Young

Avatar

Former Community Member
Sorry, make that app.execMenuItem("AddFileAttachment"); Earlier message edited for clarification.

Avatar

Former Community Member
Young Carl,



Have you been able to get it to work? I am having the same problem with having the attachment function work while in Reader. If I "enable rights for Reader" then nobody, not even Acrobat users, are able to use the attachment box. ??? Let me know if you found a solution or workaround - it's been driving me crazy.



Thanks!

Avatar

Former Community Member
The javascript looks great behaves correctly then fails when they send the form in email... any fix?



Thank you.