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

How to save pdf attachments programmatically

subbaraofool
Registered: Jul 6 2010
Posts: 7

Hi,

I have a pdf form with the fields and attachments. I was successfully able to save the field values to backend database, but my biggest challenge is to get attachments from the pdf form.

If anyone has done this before please help me, really appreciate it. I just have to export the pdf attachments when a form is being submitted. It would be nice if the attachments are directly saved to MySql database or saving on a specific path on the server also works.

Appreciate You help ..

Thanks
Rao

NK-INC.COM
Registered: Apr 17 2010
Posts: 93
Rao:

ANSWER:
If it is multiple forms or multiple submissions:
You can submit to a server-side script (ASP.net, PHP, Coldfusion), and take the binary input buffer, and use iText (or iTextSharp). iText could then extract the PDF file attachments, and you can save the binary (bytes) to file, output buffer or database. iText is Open-Source, and free.

If it is a single form:
Use iText for JAVA or iTextSharp for C#, along with your favorite programming language.


QUESTION:
What language are you familiar with or plan on using
+ VB.net / C#
+ ASP
+ ASP.net 1.1, 2.0, 3.0, 3.5
+ PHP
+ Coldfusion


NOTES:
iText is for JAVA. iText has also been transcribed to C# (.Net), and it's called iTextSharp.

Google iText
subbaraofool
Registered: Jul 6 2010
Posts: 7
Hi,

Thank You so much for your response.

Its a single form and single submission but with multiple attachments.

I am using PHP as programming language. To my understanding iTextSharp would help in exporting the attachments (using PHP) with in the PDF and save it to Database (MySql).

Could you please explain more in detail how it can be done.

Appreciate all your help.

Thanks
Rao
NK-INC.COM
Registered: Apr 17 2010
Posts: 93
subbaraofool wrote:
Its a single form and single submission but with multiple attachments.
I am using PHP as programming language. To my understanding iTextSharp would help in exporting the attachments (using PHP) with in the PDF and save it to Database (MySql).
You could use iText under JAVA.

For more information google the following:
"iText"
http://www.google.com/search?q=itext&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1"iText Extract Attachments"
http://www.mail-archive.com/itext-questions [at] lists [dot] sourceforge [dot] net/msg33331.phpI also recommend buying the electronic version of the following book:
"iText in Action"
http://www.google.com/search?hl=en&rls=com.microsoft%3Aen-us&q=iText+in+Action&aq=f&aqi=g10&aql=&oq=&gs_rfai=Sorry, but I can't help you with Java code.