1. Programming Help Needed

I need to be able to pick up a file name(which I know how to do) of a document that has been scanned, read the records of the file in EU, then load these recocrds into a database as a blob (I think this can be done) and index it with a key in my software data so that the scanned document can be later retreived and printed/emailed/faxed as needed. Any thoughts on this would be appreciated. I wanted to know if this is possible before wasting a lot of time trying to do it. I guess I could just leave the scanned document files in some directory but would rather load it into a mysql database.

new topic     » topic index » view message » categorize

2. Re: Programming Help Needed

GeorgeWalters said...

I need to be able to pick up a file name(which I know how to do) of a document that has been scanned, read the records of the file in EU, then load these recocrds into a database as a blob (I think this can be done) and index it with a key in my software data so that the scanned document can be later retreived and printed/emailed/faxed as needed. Any thoughts on this would be appreciated. I wanted to know if this is possible before wasting a lot of time trying to do it. I guess I could just leave the scanned document files in some directory but would rather load it into a mysql database.

Documents which are scanned come in as the image of a document. They need to be run through some sort of OCR software in order to be translated to actual text. Decent OCR software is often provided with the scanner. Better software would be something like Adobe Acrobat. Otherwise you'd have to write your own Optical Character Recognition algorithms.

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Programming Help Needed

GeorgeWalters said...

I need to be able to pick up a file name(which I know how to do) of a document that has been scanned, read the records of the file in EU, then load these recocrds into a database as a blob (I think this can be done) and index it with a key in my software data so that the scanned document can be later retreived and printed/emailed/faxed as needed. Any thoughts on this would be appreciated. I wanted to know if this is possible before wasting a lot of time trying to do it. I guess I could just leave the scanned document files in some directory but would rather load it into a mysql database.

I don't see a problem at all with doing this. It seems you want to just have a database record referencing the document, maybe a date that you received it and a few other fields? None of that coming from the actual image itself?

Jeremy

new topic     » goto parent     » topic index » view message » categorize

4. Re: Programming Help Needed

jeremy said...
GeorgeWalters said...

I need to be able to pick up a file name(which I know how to do) of a document that has been scanned, read the records of the file in EU, then load these recocrds into a database as a blob (I think this can be done) and index it with a key in my software data so that the scanned document can be later retreived and printed/emailed/faxed as needed. Any thoughts on this would be appreciated. I wanted to know if this is possible before wasting a lot of time trying to do it. I guess I could just leave the scanned document files in some directory but would rather load it into a mysql database.

I don't see a problem at all with doing this. It seems you want to just have a database record referencing the document, maybe a date that you received it and a few other fields? None of that coming from the actual image itself?

Jeremy

By "read the records of the file in EU" I assume he means he wants to read data out of these scanned documents. That being said, I've been wrong before, and I'll be wrong again.

-Greg

new topic     » goto parent     » topic index » view message » categorize

5. Re: Programming Help Needed

I think this is the best way as you mention. I can xcopy the document(a PDF file) to wherever it needs to go and make a data base entry of the necessary search criteria to find it and store the name and location of the doc in the database record.

Since the file is a PDF, I was wondering if it could be read using EU? IF that is the case then I could stuff it into a MySql database as a blob and then have more control and search tools to use. I'm not wanting to make any sense of what I'm reading from the PDF but just get it and stuff it into MySql for later retreival to display with an adobe reader. Do you think this is possible?

new topic     » goto parent     » topic index » view message » categorize

6. Re: Programming Help Needed

The BLOB type is intended to hold any kind of binary data. In Euphoria, if you open the file with "rb" and read it with get_bytes, you can do exactly what you are looking to do. However, if your only reason for doing so is so you can search within the files for data, I don't think this is the best tool for the job. I use the GNU program, grep, on both Linux and Windows for this purpose, and would highly recommend writing a program to parse its results from a log file over trying to re-invent its functionality.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Programming Help Needed

Experimenting with reading a PDF file, the following program appears to copy the file. However, it is only 1/2 the size of the original file and of course adobe can do anything with it. Any ideas what may be wrong?... I don't need to know what I've read, only that I've got it all correctly to stuff into mysql.

with trace without warning

object file, record, outFile sequence dataFile, outData integer count

dataFile = "c:
AcuTrack
AcuData
billedit.pdf" outData = "c:
AcuTrack
AcuData
test.pdf"

file = open(dataFile, "r") outFile = open(outData,"w")

if file >0 then

record = gets(file) count = 0 while not atom(record) do count += 1 puts(outFile, record) record = gets(file) end while

end if trace(1) abort(0)

new topic     » goto parent     » topic index » view message » categorize

8. Re: Programming Help Needed

Geez, I guess I don't know how to send a program segment. What got here was a mess.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Programming Help Needed

Let's try again.

with trace without warning

object file, record, outFile sequence dataFile, outData integer count

dataFile = "c:
AcuTrack
AcuData
billedit.pdf" outData = "c:
AcuTrack
AcuData
test.pdf" file = open(dataFile, "r") outFile = open(outData,"w")

if file >0 then

record = gets(file) count = 0 while not atom(record) do count += 1 puts(outFile, record) record = gets(file) end while

end if trace(1) abort(0)

new topic     » goto parent     » topic index » view message » categorize

10. Re: Programming Help Needed

Place the good old <eucode> ... </eucode> tags around it. Also you can preview smile

Jeremy

with trace 
without warning 
 
object file, record, outFile 
sequence dataFile, outData 
integer count 
 
	dataFile = "c:\\AcuTrack\\AcuData\\billedit.pdf" 
	outData  = "c:\\AcuTrack\\AcuData\\test.pdf" 
    file = open(dataFile, "r") 
    outFile = open(outData,"w") 
     
    if file >0 then 
     
        record = gets(file) 
        count = 0 
        while not atom(record) do 
        	count += 1 
        	puts(outFile, record) 
        	record = gets(file) 
        end while 
         
     end if 
     trace(1) 
     abort(0) 
new topic     » goto parent     » topic index » view message » categorize

11. Re: Programming Help Needed

thanks, that looks a whole lot better.

new topic     » goto parent     » topic index » view message » categorize

12. Re: Programming Help Needed

GeorgeWalters said...

thanks, that looks a whole lot better.

btw.. Try with rb, read binary. open(..., "rb") and wb for the write.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

13. Re: Programming Help Needed

Thanks, that worked great!

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu