Tire & Automotive
Tire Size Example
// import the Web SDK
const { init, errorCodes } = window.anylinejs;
// if copied into node_modules
// import { init, errorCodes } from 'anyline-js';
// create a view configuration
const viewConfig = {
...
};
const anylicense = 'xxxxxxx-your-license-xxxxxxx';
// access the container you want to mount the Web SDK into
const root = document.getElementById('root');
// initialize the Web SDK with optional presets
// presets will override some dimension configuration of your viewConfig and modules in the Web SDK config
const Anyline = init({
preset: 'tire_size',
viewConfig,
license: anylicense,
element: root,
});
Anyline.startScanning();
Anyline.onResult = function(result) {
console.log('Anyline has result: ', result);
};
License Plate Example
// import the Web SDK
const { init, errorCodes } = window.anylinejs;
// if copied into node_modules
// import { init, errorCodes } from 'anyline-js';
// create a view configuration
const viewConfig = {
...
};
const anylicense = 'xxxxxxx-your-license-xxxxxxx';
// access the container you want to mount the Web SDK into
const root = document.getElementById('root');
// initialize the Web SDK with optional presets
// presets will override some dimension configuration of your viewConfig and modules in the Web SDK config
const Anyline = init({
preset: 'lpt',
viewConfig,
license: anylicense,
element: root,
});
Anyline.startScanning();
Anyline.onResult = function(result) {
console.log('Anyline has result: ', result);
};
Vehicle Identification Number (VIN)
VIN with User Guidance
Scan VINs with dynamic UI feedback:
import { init, uiFeedbackPresets } from '@anyline/anyline-js';
const anyline = init({
license: 'YOUR_LICENSE_KEY',
element: document.getElementById('scanner-root'),
preset: 'vin_with_user_guidance',
viewConfig: {
uiFeedback: {
dynamic: uiFeedbackPresets.vin, // Enables lighting & distance feedback
static: {
instructionText: "Scan the 17-character VIN"
}
}
},
anylinePath: './anylinejs'
});
anyline.onResult = ({ result }) => {
const vinNumber = result.vinResult.text;
console.log('VIN:', vinNumber);
};
anyline.startScanning();
The vin_with_user_guidance preset with user feedback provides:
- Dynamic UI feedback: Real-time lighting and distance guidance
- Static instructions: Custom text above the cutout
- Enhanced accuracy: Helps users position the camera optimally
Available preset: vin_with_user_guidance
VIN Scanning
Fast VIN scanning without UI guidance:
import { init } from '@anyline/anyline-js';
const anyline = init({
license: 'YOUR_LICENSE_KEY',
element: document.getElementById('scanner-root'),
preset: 'vin', // Faster, simpler scanning
anylinePath: './anylinejs'
});
anyline.onResult = ({ result }) => {
console.log('VIN:', result.vinResult.text);
};
anyline.startScanning();
Available preset: vin
VIN with Check Digit Validation
Enable check digit validation for higher accuracy:
import { init } from '@anyline/anyline-js';
const anyline = init({
license: 'YOUR_LICENSE_KEY',
element: document.getElementById('scanner-root'),
preset: 'vin_with_user_guidance',
config: {
vinConfig: {
validateCheckDigit: true, // Validate ISO 3779 check digit
charWhitelist: 'ABCDEFGHJKLMNPRSTUVWXYZ0123456789' // Excludes I, O, Q
},
cancelOnResult: true
},
anylinePath: './anylinejs'
});
anyline.onResult = ({ result }) => {
const vinNumber = result.vinResult.text;
console.log('Validated VIN:', vinNumber);
// VIN is guaranteed to have correct check digit (position 9)
};
anyline.startScanning();
Web SDK VIN Options:
-
vin_with_user_guidance- Advanced scanning with dynamic UI feedback (slower but more accurate, recommended for user guidance) -
vin- VIN scanning (faster and simpler, recommended for speed)