Solved

using acrobat X Pro, how do I parse data from a fillable pdf programmatically using .net

Posted on 2013-05-30
16
474 Views
Last Modified: 2013-12-03
I'm using acrobat X Pro, how do I parse data from a fillable pdf programmatically using .net
I have attached my pdf. with the fillable data ......
This file only has 3 or 4  fillable fields filled in but should be enough to show what I mean....
I would like to receive this file via email, save it to a server, parse the information, rename the file based on whether there is a PO number, this becomes the filename or not - then use the inputted date or Now(), then email the complete form (images included) to another email while using the parsed data to fill my SQL Server tables.
So my script would look like this phonetically:
If PO > "" then filename = PO data & .pdf
elseif date > "" then filename= date & .pdf
else filename = now() & .pdf
end if
then
send email of filename to joe shmoe
then
parse name, dept, manf, style, size etc to sql server table

Am I crazy, or should this be fairly easy as all data is stored in datafields???

Please help... Thank you.
Max point to everyone....
PreveaOrderForm.pdf
0
Comment
Question by:baytowel
  • 8
  • 5
16 Comments
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
Comment Utility
0
 

Author Comment

by:baytowel
Comment Utility
Haven't had a chance to try yet, hopefully today.... thank you
0
 
LVL 5

Expert Comment

by:NKOWA
Comment Utility
Check out:
http://www.fdftoolkit.net

Online examples:
http://www.fdftoolkit.net/examples/

Open-source edition:
http://fdftoolkit.codeplex.com/

Also check out:
http://www.pdfemail.net/

Note: I haven't inspected your PDF, but if its an Acrobat Form, or a Static XFA LiveCycle PDF form, then the form can be parsed. If it's a XFA LiveCycle form saved as a "Dynamic" PDF, then you have very few options.
0
 

Author Comment

by:baytowel
Comment Utility
It is an XFA Life Cycle form saved as a "Reader Extended PDF w/ Additional Feaures"... Does that mean I'm stuck with very few options??
0
 
LVL 5

Expert Comment

by:NKOWA
Comment Utility
When in LiveCycle, click File=>Save As=>?

Does it say "Dynamic PDF", or "Static PDF" for the File Type?
0
 
LVL 5

Expert Comment

by:NKOWA
Comment Utility
You can still submit the whole PDF format with Dynamic XFA form, but you won't be able to parse it using any library.

If you submit XDP data with Dynamic XFA form, you can parse it, but you won't get the whole PDF in your email, just the XDP data.

If you submit whole PDF format or XDP data with the "Static" XFA, and you can parse XDP and parse "Static" XFA, and get the whole PDF in your inbox by merging.
0
 
LVL 5

Expert Comment

by:NKOWA
Comment Utility
Dynamic XFA are used for dynamic field and row generation in expanding tables.

If you don't need this feature, I suggest saving as (Save As) "Static PDF".
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:NKOWA
Comment Utility
If you need a custom script, or a single PDFEmail.net script, contact me:

http://www.nk-inc.com/support/sales/
0
 

Author Comment

by:baytowel
Comment Utility
If I save as a static pdf will the customer filling out the form be able to save it?
0
 

Author Comment

by:baytowel
Comment Utility
I am saving as static in adobe livecycle designer, then as Reader Extended PDF w/ Additional Feaures in adobe acrobat x pro
0
 
LVL 5

Expert Comment

by:NKOWA
Comment Utility
You can enable usage rights the PDF type regardless if it's static XFA, dynamic XFA or an Acrobat form.

The latest version of Adobe Reader doesn't need Usage Rights enabled; because, it allows the client to save with data, and submit whole PDF format. But for older versions of Adobe Reader, you can enable usage rights, and the client will be able to save it or submit whole PDF format.
0
 
LVL 5

Assisted Solution

by:NKOWA
NKOWA earned 500 total points
Comment Utility
This code will take a PDF submission and parse it:

Download the FDFToolkit.net library:
http://fdftoolkit.codeplex.com

Note: I updated the open-source project on 10/07/2013.

Dim cFDFApp as new FDFApp.FDFApp_Class
Dim cFDFDoc as new FDFApp.FDFDoc_Class

Dim pdfBytes(Request.InputStream.Length) as Byte
If Request.InputStream.Length>0 Then
Request.InputStream.Read(pdfbytes,0,request.inputStream.Length)
else
return
End if

' Load the submission stream
cFDFDoc = cFDFApp.PDFOpenFromBuf(pdfBytes)

Dim filename as string = ""
If Not String.IsNullOrEmpty(cFDFDoc.XDPGetValue("PO") & "") then 
'
 Parse the PDF form field called "PO"
filename = cFDFDoc.XDPGetValue("PO") & ".pdf"

elseif Not String.IsNullOrEmpty(cFDFDoc.XDPGetValue("date) & "") then 

filename= cFDFDoc.XDPGetValue("date") & ".pdf"
else 

filename = DateTime.now().replace(":","-").replace(" ","-") & ".pdf"

end if

' Send the PDF (pdfBytes)

Open in new window

0
 

Author Comment

by:baytowel
Comment Utility
This looks like my solution....but how do I make this work:
Dim cFDFApp as new FDFApp.FDFApp_Class
Dim cFDFDoc as new FDFApp.FDFDoc_Class

I downloaded the following library:
http://fdftoolkit.codeplex.com/

where do I need to put the code?
0
 
LVL 5

Accepted Solution

by:
NKOWA earned 500 total points
Comment Utility
You need to reference the libraries in your project, create a ASPX file, make a public sub routine to put the code, and call the routine on page load. Point the submit button URL action to the script.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now