How to read data from pdf document and insert into database?

527 Views Asked by At

I got PDF document from the customer. The document is 60 pages long. I need to read the data from middle of the page 49 to page 58. In ColdFusion there is cfpdf tag that allows reading the pdf documents. Here is example of what I have so far:

<cftry>
    <cfset mypdf = expandPath("./data.pdf")>
    <cfpdf action="read" source="#mypdf#" name="PDFInfo">

    <cfdump var="#PDFInfo#">

    <cfcatch type="any">
        <cfdump var="#cfcatch#">
    </cfcatch>
</cftry>

After document is dumped on the screen there are information like:

Author  [empty string]
CenterWindowOnScreen    no
ChangingDocument    Allowed
Commenting  Allowed
ContentExtraction   Allowed
CopyContent     Allowed 
PageSizes   
PDFDocumentarray
1   
PDFDocument - struct
height  792
width   612
2   
PDFDocument - struct
height  792
width   612
3   
PDFDocument - struct
height  792
width   612
4   
PDFDocument - struct
height  792
width   612

I never before used the cfpdf and this is something new for me. I tried to search on the web but couldn't find the example on how I can get the data from PDF document. Is there a good way to get the data from specific pages in the file/document? Also I guess there has to be a loop that will allow accessing individual row data. If anyone have a good example of resource for this problem please let me know. Thanks.

0

There are 0 best solutions below