Home > Forum Home > Developing Business Administration Solutions > Importing Data from PDF Files Share

Importing Data from PDF Files

Excel Help for Importing Data From Pdf Files in Developing Business Administration Solutions


Forum TopicPost Reply Login

Importing Data From Pdf Files

Rate this:
(4.2/5 from 24 votes)
Happy Business Spreadsheets has developed a free Excel program to extract and import PDF data into Excel which can be downloaded and used without restriction.

There is a common need to extract and import specific data from PDF files into Excel. Since Excel does not natively support the reading of PDF content, utilities are needed to convert the PDF file content for the Excel format. Several commercial applications accomplish this; however it is often the case where only specific data is required to be imported from multiple PDF files into one structured format.

We created such an application by using VBA code in conjunction with an open source PDF to Text conversion utility, which can be found at Foolabs.

[Download the free PDF data import Excel program here]

The program relies on the conversion utility (included in the download) and all PDF files to reside in the same directory as the Excel application. Text or data to extract are defined in the Control sheet by specifying start text, end text and multiple replacements routines with wildcard support. This enables flexibility to obtain comparable data from multiple PDF files based on patterns independent of different PDF file structures.

As many extraction rules as required can be set in order to create a table of information imported by extraction rule and PDF file name. Information on how to set up rules is available within the Excel application with a help icon and cell comments. The VBA code is commented and open for modification.

Any improvements or new features to the code are welcome to be posted here so that we can update the download version to the benefit of everyone.
 Excel Business Forums Administrator
 Posted by on
 
Replies - Displaying 81 to 88 of 88Order Replies By: Most recent | Chronological | Highest Rated
Oops
Rate this:
(3/5 from 1 vote)
This is definitely something that would be good to add to the code as an option. At the moment, the last instance is returned as the result.  The code loops through each line of the text content of the PDF looking for the start pattern and end pattern and saving the part in between in memory. The prt of code in the Run_Extraction() routine that gets the text is right before the end of the loop as:

VBA Code:
'test if in text gathering blCont and append
If blCont = True And strTemp <> "" And Not strLine Like "*" & cs & "*" Then
        strTemp = strTemp & Chr(10) & Trim(strLine)
End If

This needs to be modified with another variable to hold what was previously found and appended to the overall result.
 Excel Business Forums Administrator
 Posted by on
Confused
Rate this:
(3/5 from 1 vote)
and how would it look like, to take more repeatable data from one .pdf file?
which part of the code shold be changed?  maybe "For Each .... in .... loop" will help here, but which variable is  to be repeated ?


i need it, cause i got every day statement in .pdf with 120 pages and untill now i have coppied every ... 

Transaction Amount, 
Payment Details, 
Name/Address ... ect ... (around 400 copies and 400 paste-s :S)


x10 TNX
 Posted by on
Oops
Rate this:
(3/5 from 1 vote)
To recuperate multiple instances of the same rule would require a modification to the code.  The only solution currently is to define unique rules for each instance.
 Excel Business Forums Administrator
 Posted by on
Confused
Rate this:
(4/5 from 2 votes)
Hi! Congrats on this great tool!

I'd like to know how to modify the code so one could get multiple data from a single PDF.
Example:
----
New Contact
----
[Start Text:Name] data collected  [End Text]
[Start Text:Phone] data collected  [End Text]
----
New Contact
----
[Start Text:Name] data collected  [End Text]
[Start Text:Email] data collected  [End Text]
[Start Text:Address] data collected  [End Text]

Note that each client may have different fields, but the current control page its already taking care of various fields.  It would be necessary to create a check for a separator ("New Contact" in this case)
Is this possible or it would be required to develop a new code?

Thanks from Brasil 
 Alexandre
 Posted by on
Oops
Rate this:
(2/5 from 2 votes)
To recuperate interactive form data, the best solution is to use a script to load to a data connection.

Foxit Phantom PDF provides some type of ODBC connectivity via JavaScript.  Also, Adobe Acrobat provides a tool to extract XFA data into a spreadsheet.
 Excel Business Forums Administrator
 Posted by on
Confused
Rate this:
(3/5 from 1 vote)
Hi, this is very neat and quite useful. Nice work.

I was wondering, is there was someway to make this work with interactive Pdf Forms? The idea is to create a fillable form (I use Foxit Phantom) and distribute to users in the ubiquitous pdf format. They fill it and return it and then we extract the data into an excel sheet.

This would be a great addition if possible. Specially because the great thing about your tool is that it skips the need for the user to convert the file to a .xls manually. I cannot seem to find any way to do this, without actually having my end user first convert to xls and then import. When the forms number in the thousands, that's just impracticle.

Any help would be greatly appreciated. 
 "In all things, be men"
 Posted by on
Oops
Rate this:
(4/5 from 4 votes)
At this stage, the program can find the last instance of the text match in the PDF files.  It could be modified to save all matches to memory and then output them by modifying the VBA code. 

To extract exact instances of the text you need to be explicit with the start and end text by providing as much unique text as possible so that the program does not confuse it with other text in the PDF file.  In this case, there may be other text after or before "Depth" that can be specified  in order to extract the correct instance.
 Excel Business Forums Administrator
 Posted by on
Confused
Rate this:
(4.5/5 from 4 votes)
Excellent Tool and very Handy, But I have one small issue here , How is it handled when we have source/destination text appears many times.

Ex:
  Date 07/20/2008 Depth :00 m 

   When I try to grab the Date text, B/W Date and Depth it gives me wrong data as I have Depth field some where else also on the same doc.

Any inputs will be appreciated 
 Posted by on
 Displaying page 9 of 9 

Excel templates and solutions matched for Importing Data from PDF Files:

Solutions: Export MapPoint Waypoints Survey Data Analysis