npZbar plugin

About this plugin

This plugin allows you to easy scan BMP, JPG and PNG image files searching for one or more barcodes inside. The currently supported barcode symbols are I25, EAN 8, EAN 13, UPC A, UPC E, ISBN 10, ISBN 13, CODE 39, CODE 128 and QR Codes barcodes.

You can create one or more ZBar objects and use different events or share between object instances. Very easy to use by scanning BMP or JPG images and firing the appropiate event subroutine when one barcode are found inside the scaned image.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npZbarCreate

This action creates a new instance of an Zbar object. The result variable store the ID of the new Zbar object. You can use this ID with other plugin actions.

↑↑

npZbarDestroy

This action destruct a previously created Zbar object instance. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npZbarDestroyAll

This action destruct all previously created Zbar object instances.

↑↑

npZbarScanImage

Scan an image file searching for possible barcodes inside. Supported images are BMP, JPG, PNG and GIF. The result variable store the number of barcodes found or "0" (zero) if no barcodes are found. The result variable also can store "False" if an error occur. In this last case the [LastError] variable contain information about the error.

Remember in order to get the information of the matched barcodes you need to use the npOnZbarCodeMatch action. See this action help for more details.

↑↑

npOnZbarCodeMatch

Set a subroutine to be executed when a barcode are matched from the scaned image. Once you use the npZbarScanImage action the specified subroutine are called when a barcode are found. Note that this subroutine can be called more than one time if the scaned image contain more than one barcodes.

You can get the information of the matched barcode using the variables of this action. The Barcode data variable store then the data associated with the matched barcode and the Barcode symbology variable can contain one of these values:

The result variable store "True" if everythin is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

Required libraries

For the correct use of this plugin you need to deploy your publication with the included "libzbar-0.dll" and "libiconv-2.dll" files. You can found these files into the plugin installation directory and in the plugin samples directory. You need to copy these DLL's in the same directory than your publication executable or in the Windows or System32 directory if you prefer.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑