Barcode API: Generate Graphics from Your Own Application
Barcode Vectorizer comes in two editions: Standard and Pro. The Pro Edition, among its other features, enhances the software with an API that seamlessly generates high-quality barcode graphics from within your own application.Barcode Generator API – The Interface
The interface is an executable file named bcvc.exe, located in the program's installation folder. You can access usage help by running this file from the command line without any parameters:Syntax
Syntax: bcvc.exe [options] BarcodeNumber DesignFile OutputFile
Example: bcvc.exe -hres=600 -vres=600 -colorspace=cmyk "123456" design.bcvp output.eps
Each of the three parameters BarcodeNumber, DesignFile, and
OutputFile must be enclosed in double quotes if they contain spaces. The API automatically
determines the target graphic format based on the file extension of OutputFile. Supported file
extensions include: .pdf .eps .svg .png .bmp .jpg .jpeg. DesignFile refers to the
pre-designed template that must be created in GUI mode beforehand.
Example: bcvc.exe -hres=600 -vres=600 -colorspace=cmyk "123456" design.bcvp output.eps
For applicable barcode types, an optional add-on number can be provided after the main number, separated by a '#' symbol. Here's an example of a GTIN-13 (EAN-13) with an add-on 5:
4013456367128#12345
The following parameters are available as [options]:
-hres and -vres – Horizontal and vertical resolution (dpi) for the generated graphic. Both parameters are optional for vector formats and required for raster formats.
-tiffres – Only for EPS: Resolution (dpi) for the embedded TIFF preview. The default value is 240; setting it to 0 generates an EPS file without a preview.
-colorspace – RGB (default) or CMYK. The parameter is optional and is ignored if the target format is other than PDF or EPS.
-designindex – Index of the template within "DesignFile". This is an optional parameter, with a default value of 1.
-tiffres – Only for EPS: Resolution (dpi) for the embedded TIFF preview. The default value is 240; setting it to 0 generates an EPS file without a preview.
-colorspace – RGB (default) or CMYK. The parameter is optional and is ignored if the target format is other than PDF or EPS.
-designindex – Index of the template within "DesignFile". This is an optional parameter, with a default value of 1.
Error Handling
Upon termination, the API returns an Exit Code, also known as ERRORLEVEL in batch file programming. The Exit Code is generally an integer that provides information about how a program was terminated. Programming languages capable of launching external processes typically offer functions or methods to query the Exit Code following the completion of a process. A calling program can use these functions to respond to potential states and errors accordingly.Exit Codes:
0 – Barcode graphic generation completed successfully.
1 – Invalid number of parameters.
11 – "-hres" must be a positive integer.
12 – "-hres" parameter is required for raster formats (PNG, BMP, JPG).
13 – "-vres" must be a positive integer.
14 – "-vres" parameter is required for raster formats (PNG, BMP, JPG).
18 – "-tiffres" must be greater than or equal to 0.
20 – "-colorspace" must be either RGB or CMYK.
30 – "-designindex" must be an integer between 1 and 20.
31 – "-designindex" exceeds the actual number of templates in "DesignFile".
40 – "DesignFile" not found.
41 – Error while reading "DesignFile".
50 – "OutputFile" does not have any of the supported file extensions.
51 – Directory for "OutputFile" does not exist.
52 – Error while writing to "OutputFile".
60 – Barcode number cannot be represented with the current barcode type.
70 – Insufficient memory, possibly due to an unrealistically high chosen resolution.
1 – Invalid number of parameters.
11 – "-hres" must be a positive integer.
12 – "-hres" parameter is required for raster formats (PNG, BMP, JPG).
13 – "-vres" must be a positive integer.
14 – "-vres" parameter is required for raster formats (PNG, BMP, JPG).
18 – "-tiffres" must be greater than or equal to 0.
20 – "-colorspace" must be either RGB or CMYK.
30 – "-designindex" must be an integer between 1 and 20.
31 – "-designindex" exceeds the actual number of templates in "DesignFile".
40 – "DesignFile" not found.
41 – Error while reading "DesignFile".
50 – "OutputFile" does not have any of the supported file extensions.
51 – Directory for "OutputFile" does not exist.
52 – Error while writing to "OutputFile".
60 – Barcode number cannot be represented with the current barcode type.
70 – Insufficient memory, possibly due to an unrealistically high chosen resolution.