ImgSource_Acquire_JSN

Acquire images from an image source.
ImgSource_Acquire_JSN(sourceID;optionsJSON) ➔ resultJSON
sourceID Text The image source ID
optionsJSON Text Image acquisition options
↩︎ resultJSON Text The image acquisition results encoded as a JSON object

Run an image acquisition session and return the acquisition results encoded in JSON format.

Parameter sourceID is the ID of the image source.

The optional parameter optionsJSON is a 4D object encoded in JSON format that can used to specify options for the acquisition session. The properties of this object are listed in the following tables.

General Acquisition Options
Property name Description
Directory

The option’s value is a string containing the full pathname of the destination directory. The pathname must be in POSIX format.

If this option is not specified, it defaults to the system temporary directory.

Multiple

The option’s value is a boolean, denoting whether or not to acquire multiple images in a single session.

If this option is not specified, its default value is False.

GUIVisible

The option’s value is a boolean, denoting whether to display or not the source’s acquisition GUI. Effective only on sources that support hiding their GUI.

If this option is not specified, its default value is True.

TWAIN Acquisition Options
Property name Description
FunctionalUnit The option’s value is a string denoting the scanner’s functional unit to be used. Can be one of: Flatbed, ADF, PositiveTPU, or NegativeTPU.
Duplex

The option’s value is a boolean. Set to True to enable duplex scanning.

If this option is not specified, its default value is False.

PixelType The option’s value is a string. Set to BW, Gray, or RGB to scan in black & white, grayscale, or color respectively.
DPISize The option’s value is a SizeObj. Set the Width and Height properties to the desired scanning resolution

Note

For the above TWAIN options to be effective, the scanner driver must support setting the corresponding TWAIN capabilities. Compliant drivers usually support these options when the GUI is hidden (GUIVisible option set to False). There may be drivers that support these options in their GUI, but that’s a rare case.

Digital Camera Acquisition Options (IC/WIA protocols)
Property name Description
DeleteAfter

The option’s value is a boolean. Set to True to remove the images from the camera after downloading successfully.

If this option is not specified, its default value is False.

SystemGUI

The option’s value is a boolean, denoting whether to use the system UI, if available, rather than the vendor-supplied UI. Effective only on WIA sources.

If this option is not specified, its default value is False.

The results of a successful acquisition session are returned in resultJSON in the form of a 4D object encoded in JSON.

The resultJSON object will contain the following properties:

Image acquisition results
Key Description
Images The property’s value is an array of strings containing the full pathnames of the acquired images.
Sidecars

This property is optional, and typically present in acquisitions from digital cameras with the IC protocol.

When present, it is an object containing arrays of strings. For each image pathname in the "Images" array, there is a property in "Sidecars" named with the image’s pathname. The "Sidecars" property value is an array containing the pathnames of the sidecar files corresponding to the image.

Note

The ImgSource_Acquire method in the Q2PixLib component is a convenience wrapper for this method that accepts and returns directly 4D objects instead of a JSON serializations.