These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How do I add an "attach files" button in my PDF form?

jamhtx
Registered: Oct 30 2008
Posts: 2

I am working in Acrobat Pro 9 Mac. I need a form that novice users can attach files (pdf, excel, etc.) to my fillout PDF form using Reader 8, then submit via email. I cannot figure out how to add a button/field within my form to do this...can it be done?

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
From a document script you cannot actually attach a file to the PDF. The functions for doing this particular action are restricted to a privileged context. However, you can embedd a file into submitted FDF data.

1. Add a text field and a button field to the PDF.
2. Name the text field "FileSubmit",
3. On the options tab of the Text field properties dialog, check "Field is used for file selection".
4. Add this script to the MouseUp action of the button

this.getField("FileSubmit").browseForFileToSubmit();

5. Add a submit button to the form,
6. Set the button up to submit the data in FDF format. This is the only format that can embed file data.

This setup will allow the user to submit a file, embedded in the FDF data. The next task of course is for you to be able to extract the file from the FDF data. The Adobe FDF toolkit is a library of functions for manipulating FDF data. It comes in versions for Perl, VB, C++, and ASP. And it's FREE!! However, you'll have to write your own application, either desktop or server side.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script