Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

WIA.Scan

Transfers data from the given item to the application.

Component Version macOS Windows Linux Server iOS SDK
WIA 6.5 ❌ No ✅ Yes ❌ No ❌ No ❌ No
MBS( "WIA.Scan"; Item )   More

Parameters

Parameter Description Example
Item The item of current device to query.
For a scanner this is typical Flatbed or Feeder.
see WIA.ListItems
"Flatbed"

Result

Returns OK or error.

Description

Transfers data from the given item to the application.
We normally put the files on successful transfer into temp file and you get paths back from WIA.Image function.

If the document feeder fails to supply an image, the returned path to image file will be empty.

Examples

Scan via flatbed:

MBS( "WIA.Scan"; "Flatbed" )

Scan via feeder:

MBS( "WIA.Scan"; "Feeder" )

Scan duplex from document feeder:

# switch on duplex mode
Set Variable [ $r ; Value: MBS( "WIA.SetItemPropertyValue"; "Feeder"; "Document Handling Select"; 4 ) /* 1 = feeder 2 = flatbed 4 = duplex 8 = front first 16 = back first 32 = front only 64 = back only 128 = next page 256 = preferred 512 = auto advance see https://docs.microsoft.… ]
#
# Scan via document Feeder
Set Variable [ $r ; Value: MBS( "WIA.Scan"; "Feeder") ]
#
# Result can be OK or Cancel and in both cases some images may be there
If [ $r ≠ "OK" ]
    Show Custom Dialog [ "Scan Result" ; $r ]
Else
    Perform Script [ Specified: From list ; “Import Images” ; Parameter: ]
End If

See also

Release notes

  • Version 8.3
    • Changed WIA.Scan to handle multiple pages better.

Example Databases

Blog Entries

This function is free to use.

Created 28th November 2016, last changed 11st February 2019


WIA.ListItems - WIA.SelectDeviceDialog