Scanning Invoices (TWAIN?)

KlaasFeenstra
Member Posts: 35
Hello,
I am looking for a solution to activate a scanner from Microsoft Dynamics Nav using automation. I was looking on the internet for some freeware programs that I could use and with the use of automation, scan a document and once scanned, move it to another configured location. I hope someone can help me.
Thanks in advance,
Klaas
I am looking for a solution to activate a scanner from Microsoft Dynamics Nav using automation. I was looking on the internet for some freeware programs that I could use and with the use of automation, scan a document and once scanned, move it to another configured location. I hope someone can help me.
Thanks in advance,
Klaas
0
Comments
-
I don't know any freeware for that but recently had someone over of ScannerVision. That looked promising. Lot's of possibilities and it isn't expensive. But we only talked it through, were not using it ourselves.
http://www.scannervision.eu/0 -
I tested it long time ago...
Some globals are not necessary (I've tested filters and converting between different formats). But you can find out what to do.Name DataType Subtype Length DeviceManager Automation 'Microsoft Windows Image Acquisition Library v2.0'.DeviceManager DeviceInfos Automation 'Microsoft Windows Image Acquisition Library v2.0'.DeviceInfos Device Automation 'Microsoft Windows Image Acquisition Library v2.0'.Device CommonDialog Automation 'Microsoft Windows Image Acquisition Library v2.0'.CommonDialog Item Automation 'Microsoft Windows Image Acquisition Library v2.0'.IItem Items Automation 'Microsoft Windows Image Acquisition Library v2.0'.IItems Property Automation 'Microsoft Windows Image Acquisition Library v2.0'.Property Properties Automation 'Microsoft Windows Image Acquisition Library v2.0'.Properties ImageFile Automation 'Microsoft Windows Image Acquisition Library v2.0'.ImageFile VT_Index Variant VT_Value Variant RlshpMgtCommentLine Record Rlshp. Mgt. Comment Line CompanyInfo Record Company Information SalesComment Record Sales Comment Line FileOnly Text 150 i Integer FileName Text 50 Scan(FileNameIn : Text[50];"No." : Code[20];Scan_Date : Date;Tip : Text[30];NoPages : Integer) CompanyInfo.GET ; i:= 0 ; CREATE(DeviceManager) ; CREATE(CommonDialog) ; DeviceInfos := DeviceManager.DeviceInfos ; //Get WIA devices IF DeviceInfos.Count = 0 THEN EXIT ; //Check number of WIA devices Device := CommonDialog.ShowSelectDevice ; //If found at least 1 device, show WIA.SelectDeviceDialog Items := Device.Items ; //Retrieve Items in device Item := Items.Item(1) ; //... and we assume only one scanner (item(1) ) Properties := Item.Properties ; //enumerating Properties we can find DeviceType VT_Index := 5 ; //HOR_RES //Selecting specific property Property := Properties.Item(VT_Index) ; VT_Value := 150 ; Property.Value := VT_Value ; VT_Index := 6 ; //VERT_RES Property := Properties.Item(VT_Index) ; VT_Value := 150 ; Property.Value := VT_Value ; VT_Index := 15 ; //Current Intent Property := Properties.Item(VT_Index) ; VT_Value := 4 ; Property.Value := VT_Value ; //Scan!!! REPEAT i := i + 1 ; FileName := FileNameIn+'-'+FORMAT(i)+'.bmp' ; CLEAR(ImageFile) ; CREATE(ImageFile) ; //MESSAGE(FileName) ; //IF NoPages > 1 THEN CommonDialog.ShowAcquireImage ; CommonDialog.ShowTransfer(Item) ; ImageFile := Item.Transfer ; //We should define filename IF EXISTS(CompanyInfo."Path for scanned documents"+'\'+FileName) THEN ERASE(CompanyInfo."Path for scanned documents"+'\'+FileName) ; ImageFile.SaveFile(CompanyInfo."Path for scanned documents"+'\'+FileName) ;
0 -
Thanks a lot for your post. It was of great value!!0
-
I am testing the code for scanning invoices, but it only scans a part of the invoice. I am trying to find out wich property I have to set, but without any result. I hope someone can help me...
Scan('Test',1) Scan(FileNameIn : Text[50];NoPages : Integer) CompanyInfo.GET ; i:= 0 ; CREATE(DeviceManager) ; CREATE(CommonDialog) ; DeviceInfos := DeviceManager.DeviceInfos ; //Get WIA devices IF DeviceInfos.Count = 0 THEN EXIT ; //Check number of WIA devices Device := CommonDialog.ShowSelectDevice ; //If found at least 1 device, show WIA.SelectDeviceDialog Items := Device.Items ; //Retrieve Items in device Item := Items.Item(1) ; //... and we assume only one scanner (item(1) ) Properties := Item.Properties ; //enumerating Properties we can find DeviceType VT_Index := 6 ; //HOR_RES //Selecting specific property Property := Properties.Item(VT_Index) ; VT_Value :=0 ; Property.Value := VT_Value ; {VT_Index := 6 ; //VERT_RES Property := Properties.Item(VT_Index) ; VT_Value := 150 ; //Property.Value := VT_Value ; VT_Index := 15 ; //Current Intent Property := Properties.Item(VT_Index) ; VT_Value := 4 ; //Property.Value := VT_Value ; } //Scan!!! REPEAT i := i + 1 ; FileName := FileNameIn+'-'+FORMAT(i)+'.jpg' ; CLEAR(ImageFile) ; CREATE(ImageFile) ; //MESSAGE(FileName) ; CommonDialog.ShowAcquireImage(1,1,131072,wiaFormatJPEG) ; ImageFile := CommonDialog.ShowTransfer(Item,wiaFormatJPEG,TRUE) ; //ImageFile := Item.showTransfer(wiaFormatJPEG) ; //We should define filename IF EXISTS(CompanyInfo."Path for scanned documents"+'\'+FileName) THEN ERASE(CompanyInfo."Path for scanned documents"+'\'+FileName) ; ImageFile.SaveFile(CompanyInfo."Path for scanned documents"+'\'+FileName) ; UNTIL i = NoPages;
Thanks0 -
KlaasFeenstra wrote:...I was looking on the internet for some freeware programs that I could use ....
Arrrrgghhhhhh ](*,) ](*,) ](*,) ](*,)
Freeware has its place and I am a strong supporter of community based software. But it has its place and I am not saying you wont find a free product to do what you want. But you should be looking at the cost of the whole project, not the raw cost of the software, If you do that you will end out spending far more money than if you just bought a working product.
Of course if you find a great freeware product, use it, But don't limit or even begin your search with the criteria of FREE.David Singleton0 -
KlaasFeenstra wrote:I am testing the code for scanning invoices, but it only scans a part of the invoice. I am trying to find out wich property I have to set, but without any result. I hope someone can help me...
Scan('Test',1) Scan(FileNameIn : Text[50];NoPages : Integer) CompanyInfo.GET ; i:= 0 ; CREATE(DeviceManager) ; CREATE(CommonDialog) ; DeviceInfos := DeviceManager.DeviceInfos ; //Get WIA devices IF DeviceInfos.Count = 0 THEN EXIT ; //Check number of WIA devices Device := CommonDialog.ShowSelectDevice ; //If found at least 1 device, show WIA.SelectDeviceDialog Items := Device.Items ; //Retrieve Items in device Item := Items.Item(1) ; //... and we assume only one scanner (item(1) ) Properties := Item.Properties ; //enumerating Properties we can find DeviceType VT_Index := 6 ; //HOR_RES //Selecting specific property Property := Properties.Item(VT_Index) ; VT_Value :=0 ; Property.Value := VT_Value ; {VT_Index := 6 ; //VERT_RES Property := Properties.Item(VT_Index) ; VT_Value := 150 ; //Property.Value := VT_Value ; VT_Index := 15 ; //Current Intent Property := Properties.Item(VT_Index) ; VT_Value := 4 ; //Property.Value := VT_Value ; } //Scan!!! REPEAT i := i + 1 ; FileName := FileNameIn+'-'+FORMAT(i)+'.jpg' ; CLEAR(ImageFile) ; CREATE(ImageFile) ; //MESSAGE(FileName) ; CommonDialog.ShowAcquireImage(1,1,131072,wiaFormatJPEG) ; ImageFile := CommonDialog.ShowTransfer(Item,wiaFormatJPEG,TRUE) ; //ImageFile := Item.showTransfer(wiaFormatJPEG) ; //We should define filename IF EXISTS(CompanyInfo."Path for scanned documents"+'\'+FileName) THEN ERASE(CompanyInfo."Path for scanned documents"+'\'+FileName) ; ImageFile.SaveFile(CompanyInfo."Path for scanned documents"+'\'+FileName) ; UNTIL i = NoPages;
Thanks0 -
When I select a preview, I see all of the page, but once scanned it only takes the bottem left of the page. When I use the scanner with other aplications, it works fine. Can you also give me a hint how to scan multiple pages in only one document?
Thanks in advance!!!
Klaas0 -
As I remember, it is possible to open Scan/preview dialog where you can change settings.
I tried scanning multipage tiff but could not figure out how to. But that was 5 years ago and I had very few experience with automations.
Now I'm using barcdes on documents and then, using barcode OCR and file splitter, split multipage tiff in separated pdf files.
Search for WIA on Microsoft MSDN. I think you have to define format and other options.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions