Solved

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

Posted on 2013-05-30
16
479 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
16 Comments
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 39212233
0
 

Author Comment

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

Expert Comment

by:NKOWA
ID: 39510771
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:baytowel
ID: 39561968
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
ID: 39561983
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
ID: 39561990
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
ID: 39561994
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
 
LVL 5

Expert Comment

by:NKOWA
ID: 39562008
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
ID: 39562018
If I save as a static pdf will the customer filling out the form be able to save it?
0
 

Author Comment

by:baytowel
ID: 39562027
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
ID: 39562031
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
ID: 39562053
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
ID: 39613246
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
ID: 39616954
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 Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 INTRODUCTION This Article is a follow-up to the Article entitled How To Rename-Move a Batch of PDF Files Based o…
This article is in response to a question here (http://www.experts-exchange.com/Other/URLs/Q_28283850.html) at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

730 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