1. Programming Help Needed
- Posted by GeorgeWalters Aug 07, 2008
- 889 views
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.
2. Re: Programming Help Needed
- Posted by ghaberek (admin) Aug 07, 2008
- 869 views
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
3. Re: Programming Help Needed
- Posted by jeremy (admin) Aug 07, 2008
- 859 views
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
4. Re: Programming Help Needed
- Posted by ghaberek (admin) Aug 07, 2008
- 861 views
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
5. Re: Programming Help Needed
- Posted by GeorgeWalters Aug 08, 2008
- 821 views
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?
6. Re: Programming Help Needed
- Posted by m_sabal Aug 08, 2008
- 802 views
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.
7. Re: Programming Help Needed
- Posted by GeorgeWalters Aug 08, 2008
- 884 views
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)
8. Re: Programming Help Needed
- Posted by GeorgeWalters Aug 08, 2008
- 840 views
Geez, I guess I don't know how to send a program segment. What got here was a mess.
9. Re: Programming Help Needed
- Posted by GeorgeWalters Aug 08, 2008
- 823 views
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)
10. Re: Programming Help Needed
- Posted by jeremy (admin) Aug 08, 2008
- 833 views
Place the good old <eucode> ... </eucode> tags around it. Also you can preview
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)
11. Re: Programming Help Needed
- Posted by GeorgeWalters Aug 08, 2008
- 867 views
thanks, that looks a whole lot better.
12. Re: Programming Help Needed
- Posted by jeremy (admin) Aug 08, 2008
- 833 views
thanks, that looks a whole lot better.
btw.. Try with rb, read binary. open(..., "rb") and wb for the write.
Jeremy
13. Re: Programming Help Needed
- Posted by GeorgeWalters Aug 08, 2008
- 799 views
Thanks, that worked great!