Our Products
Versione Italiana
Servoy Scanner Plugin (new!)
Servoy plugin to acquire images from TWAIN scanners and cameras directly in your solution.
You can acquire images without user interaction or let the user choose his preferred settings in the TWAIN driver interface.
Works on Windows 2000/XP/Vista and MacOS X.
SintPro Scanner Plugin is a Servoy plugin written in java that allows direct acquisition of images from any TWAIN source (scanners, digital cameras and webcams) in a Servoy solution running on the smart client.
The image can be acquired in JPG, GIF or PNG format and can be processed within a servoy method and stored in the backend or on the local hard disk.
The plugin let you show to the user the interface supplied by the TWAIN driver letting him pick all the settings or acquire directly without user action supplying all the needed parameters to the driver with a servoy method. You can specify the TWAIN source to acquire from, the resolution in DPI, the color bits and the frame borders.
Using the following methods you can acquire the list of all the installed TWAIN sources and their features:
|
// Returns the names of the TWAIN sources available as an Array
var srcArray = plugins.sintproScannerPlugin.GetTwainSources();
// Returns an Object with the capabilities of a given TWAIN source
var sourceObject = plugins.sintproScannerPlugin.GetSourceInfo('source');
var supportedXResArray = sourceObject[0];
var supportedYResArray = sourceObject[1];
var supportedPixelTypesArray = sourceObject[2];
var supportedBitDepthsArray = sourceObject[3];
var supportedUnitsArray = sourceObject[4]; |
The real image acquisition can be left to the user or executed programmatically like this:
// Scan from the user selected source in the specified format (jpg/png/gif)
var scanObject = plugins.sintproScannerPlugin.Scan('license_key','png');
// Scan from the specified source in the specified format (jpg/png/gif)
var scanObject = plugins.sintproScannerPlugin.QuickScan('license_key',srcArray[0],'jpg');
// Scan using the specified parameters without user interaction
// The following line returns a RGB color image in jpg format at 300dpi in 8bit from the first Twain source
// And sets 0 (=inches) as unit for border measuring
// PixelTypes: b/w=0, grayscale=1, color=2
// The frame values need to be passed in the proper order: l,t,r,b
var scanObject = plugins.sintproScannerPlugin.AutoScan('license_key',srcArray[0],300,2,8,'jpg',0,0,0,0,0));
|
SintPro Scanner Plugin will return an object containing the acquired image and the details of the scan process:
// The returned scanObject can be processed with Servoy's standard functions
var img = plugins.images.getImage(scanObject[0]);
var xRes = scanObject[1]
var yRes = scanObject[2]
var pixelType = scanObject[3]
var bitDepth = scanObject[4]
// Process the image using the images plugin
var height = img.getHeight();
var width = img.getWidth();
var contentType = img.getContentType();
var scaled_image = img.resize(150,150); |
If the TWAIN device supports Autofeed you can acquire a set of images all at once like this:
// Scan multiple pages using the specified parameters without user interaction
// The following line returns a RGB color image in jpg format at 300dpi in 8bit from the first Twain source
// PixelTypes: b/w=0, grayscale=1, color=2
var resultsArray = plugins.sintproScannerPlugin.MultipageScan('license_key',source,300,2,8,'jpg',
'/tmp/my_image_');
var imageFilesArray = resultsArray[0] // Array with the file names of acquired images
var xRes = resultsArray[1]
var yRes = resultsArray[2]
var pixelType = resultsArray[3]
var bitDepth = resultsArray[4]
// Load the images using File and Image plugin
for ( var i = 0 ; i < imageFilesArray.length ; i++ )
{
var imageData = plugins.file.readFile(imageFilesArray[i]);
var image = plugins.images.getImage(imageData);
var height = image.getHeight();
var width = imgage.getWidth();
var contentType = image.getContentType();
// Do all your stuff on this image and get the next one...
} |
SintPro Scanner Plugin is available in two license options:
Server License: valid for all the solutions of a single Servoy server:
Price: € 99,00
Developer License: valid for all the solutions developed by the license owner:
Price: € 299,00
You can download a fully working version from the Downloads section.
Remember to register for a FREE 30 days Trial License.
Want to know how we can help your business? Reach us at info@sintpro.com !