Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
WIA.SetItemPropertyValue
Sets a property of an item.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WIA | 6.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Item | The item of current device to query. For a scanner this is typical Flatbed or Feeder. see WIA.ListItems |
"Flatbed" | |
Key | The property key. Can be a text with the name of the property or the corresponding ID. |
"Name" | |
Value | The new value for this property. | ||
Type | Available in MBS FileMaker Plugin 12.1 or newer. The data type to use. By default if empty or auto, we detect it based on the type of the existing property. Can be Boolean, Int16, Int32, Int64, UInt16, UInt32, UInt64, GUID, CLSID, String or Double. |
"Int32" | Optional |
Result
Returns OK or error.
Description
Sets a property of an item.Please query with WIA.ItemProperties to see what keys and values are possible. You may want to query before and after setting the value via dialog.
Examples
Set resolution:
MBS( "WIA.SetItemPropertyValue"; "Flatbed"; "Horizontal Resolution"; 300 ) &
MBS( "WIA.SetItemPropertyValue"; "Flatbed"; "Vertical Resolution"; 300 )
Set rotation:
MBS( "WIA.SetItemPropertyValue"; "Flatbed"; "Rotation"; 2 )
// 0 = Portrait, 1 = Landscape, 2 = Rotate 180, 3 = Rotate 270
Set gray or color:
MBS( "WIA.SetItemPropertyValue"; "Feeder"; "Current Intent"; 2)
// 1 = color
// 2 = gray
Set duplex:
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.com/en-us/windows-hardware/drivers/image/wia-dps-document-handling-select
*/ ]
Show Custom Dialog [ "Set duplex" ; $r ]
Set to ignore blank pages:
Set Variable [ $r ; Value: MBS( "WIA.SetItemPropertyValue"; "Feeder"; "Blank Pages"; 1 )
/*
0 = Blank page detection is disabled. This is the required default value if the property is supported.
1 = The device detects blank pages and automatically skips scanning them (discards scanned data if any) and continues scanning.
2 = The device detects blank pages and acts as configured through the Job Separators property. This value is valid only when the Feeder item supports the Job Separators property.
see
https://docs.microsoft.com/en-us/windows-hardware/drivers/image/wia-ips-blank-pages
*/ ]
Show Custom Dialog [ "Set blank pages" ; $r ]
Set to scan only front page:
Set Variable [ $r ; Value: MBS( "WIA.SetItemPropertyValue"; "Feeder"; "Document Handling Select"; 32 )
Set image format to JPEG:
MBS( "WIA.SetItemPropertyValue"; "Flatbed"; "Format"; "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}" )
Set page size:
MBS( "WIA.SetItemPropertyValue"; "Feeder"; "Page Size"; 0) // A4
Disable auto cropping:
MBS( "WIA.SetItemPropertyValue"; "Flatbed"; "Auto-Crop"; 0)
// Values are 0 = Disable, 1 = Single and 2 = Multi
See also
- WIA.DevicePropertyValue
- WIA.ItemProperties
- WIA.ItemPropertyValue
- WIA.ListItems
- WIA.Scan
- WIA.SetDevicePropertyValue
Release notes
- Version 12.1
- Added GUID (or CLSID) as type for WIA.SetDevicePropertyValue and WIA.SetItemPropertyValue function.
- Added type parameter for WIA.SetItemPropertyValue function.
Example Databases
Blog Entries
This function checks for a license.
Created 28th November 2016, last changed 18th February 2022
