Anyline View Configuration
Configuring your Anyline plugin with JSON
The most common way to set up your Anyline scanning solution, regardless of the platform you are running, would be through a configuration string in the JSON format.
ScanViewPlugins and ScanViews are initialized using JSON strings.
JSON configs for scanning use cases are typically defined on Check out the platform-specific documentation on how to accomplish this for your respective platform. |
The Structure of a JSON configuration
A typical Anyline configuration in JSON has the following structure:
-
viewPluginConfig
: contains a group of related configurations as follows below:-
pluginConfig
: the plugin to use, and options pertaining to it -
cutoutConfig
: how the scan view cutout would look -
scanFeedbackConfig
: how feedback during scanning would appear and behave
-
-
cameraConfig
: camera properties for the platform -
flashConfig
: platform-specific properties for the flash (or torch) module
From this structure, only |
The following JSON configuration (defining a TIN tire scanning use case) shows a typical example:
{
"viewPluginConfig": {
"pluginConfig": {
"id": "tin-dot",
"tinConfig": {
"scanMode": "UNIVERSAL"
},
"cancelOnResult": true
},
"cutoutConfig": {
"width": 750,
"alignment": "top_half",
"ratioFromSize": { "width": 4, "height": 1 },
"cornerRadius": 1,
"strokeColor": "0099ff",
"strokeWidth": 2,
"feedbackStrokeColor": "8be9fd"
},
"scanFeedbackConfig": {
"style": "contour_rect",
"strokeWidth": 2,
"cornerRadius": 4
}
},
"cameraConfig": {
"pictureResolution": "1080p"
},
"flashConfig": {
"mode": "manual",
"alignment": "top_left"
}
}
We will go over each configuration property in detail in the subsequent sections.
Note that there is a special JSON structure used for composite scanning use-cases. For more details, please head over to the corresponding documentation for your specific platform. |
viewPluginConfig
The viewPluginConfig
is an aggregate structure containing a pluginConfig
, a cutoutConfig
, and a scanFeedbackConfig
(the latter two of which are optional).
pluginConfig
A pluginConfig
defines what scanning models are used (e.g. License Plate, ID, Meter, and so on), as well as
scanning options related to the plugin used.
Please see the respective platform’s documentation for complete details on plugin configuration with use cases supported by Anyline.
cutoutConfig
A cutoutConfig
includes configuration details on how the scan view’s cutout, which indicate the location within the
camera frame the scanning process should concentrate on, should appear.
Property Name | Note | Default Value |
---|---|---|
|
A preset location in the scan view where the cutout will be placed. Values: |
|
|
The cutout’s suggested width in pixels, based on device resolution width. Will be used, unless
If zero, will be computed based on values from
|
0 |
|
Numeric value representing the maximum width in percent (0-100) of the scan view the cutout will occupy, subject to constraints set by device resolution, Note: will also work if defined as a string, e.g. |
100 |
|
Numeric value representing the maximum height in percent (0-100) of the scan view the cutout will occupy, subject to constraints set by device resolution, Note: will also work if defined as a string, e.g. |
100 |
|
A size value constraining the cutout width-height ratio. e.g. If the size is zero, evaluates to a full frame cutout (please note that this only works well for barcode use cases). |
|
|
Stroke width of the cutout |
0 |
|
Stroke color of the cutout as a hex string (e.g. "00CCFF") |
|
|
Color of the cutout when the scanner is reporting feedback as a hex string (e.g. "00CCFF") |
|
|
Amount of corner rounding applied to the cutout |
0 |
|
Background color as a hex string. Use a hex string format (either "XXXXXX", or "XXXXXXXX" wherein the first two digits are to be considered as the alpha component) |
|
|
Position offset of the cutout, used in conjunction with |
|
|
(Not currently supported) A custom image used for the cutout |
null |
|
Animation type for the cutout when initially displayed. Values: |
|
|
Amount of padding to be applied to the cutout (NOTE: use positive amounts only). A crop padding truncates the visual area represented by the cutout used in optimizing scan performance for some plugins. Define as a width-height structure. Unit: Absolute pixels (Android, iOS). |
|
|
Used in conjunction with |
|
While generally all plugins (Technical Capabilities) require a cutout region for best performance and results, Barcode also allows usage completely without a To make use of Full Frame Scanning for Barcode simply remove the Please be aware that this is only supported on Barcode Scanning. |
scanFeedbackConfig
A scanFeedbackConfig
determines how the scan view behaves when objects of interest are detected during scanning.
Property Name | Note | Default Value |
---|---|---|
|
The scan feedback style displayed when an object is detected. Possible values:
|
|
|
Stroke color of the visual feedback. Use a hex string in the |
|
|
Fill color of the visual feedback. Use an "XXXXXXXX" hex string with the first two characters representing the alpha component of the fill |
|
|
Stroke width of the visual feedback, in pixels |
2 |
|
The corner rounding level of visual feedback shapes drawn |
1 |
|
The amount of time a visual feedback object remains on screen until it is removed |
0 |
|
How long the animation lasts, in ms |
75 |
|
The animation style used with the visual feedback drawn on the scan view. Values: Not supported on iOS. |
None |
|
A boolean indicating whether a brief "flicker" of the scan view is shown when an object is successfully scanned |
false |
|
A boolean indicating whether a device beep sound is played when an object is successfully scanned |
false |
|
A boolean indicating whether the device should vibrate briefly when an object is succesfully scanned |
false |
cameraConfig
A cameraConfig
configures the camera module to be used during scanning.
Property Name | Note | Default Value |
---|---|---|
|
Whether to use the back camera ( Possible values:
|
|
|
The camera resolution to use. Currently (for iOS) only Possible values (Android only):
|
|
|
The display resolution to use. Currently (for iOS) only Possible values (Android only): * |
|
|
A boolean indicating whether pinch-to-zoom is enabled for the scan view |
false |
|
The zoom factor (magnification) used by the camera |
1 |
|
If |
0 |
flashConfig
A flashConfig
configures the flash (or torch) module which can be used to brighten up the sample for more
accurate scanning.
Property Name | Note | Default Value |
---|---|---|
|
Control the flash behavior. Possible values:
|
|
|
Position of the flash toggle within the scan view, if visible. Possible values:
|
|
|
Position offset of the flash toggle within the scan view, after |
|
|
String indicating the image name of the flash toggle for "on". If null, will use the default flash toggle image.
|
null |
|
String indicating the image name of the flash toggle for "off". If null, will use the default flash toggle image.
|
null |
|
String indicating the image name of the flash toggle for "auto". If null, will use the default flash toggle image.
|
null |
Get help
If there is anything you are missing, you require support, or want to provide us with feedback, please reach out to us via https://support.anyline.com, where you either may find helpful information in our Knowledge Base or you can open a Support Ticket for more specific inquiries. In order to better assist you, please include any code of your Anyline integration and any ScanViewConfig you are using. |