Barcode API: Generate Graphics from Your Own Application
Barcode Vectorizer is available in two editions: Standard and Pro. The Pro Edition, among other features, includes an API that seamlessly generates high-quality barcode graphics directly from your own application.Barcode Generator API – The Interface
The interface is provided by an executable file named bcvc.exe, which is located in the program's installation folder. To access usage instructions, run 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. 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 barcode types in the UPC family, an optional Add-On number can be appended to the main number, separated by a '#' symbol. Here's an example of an EAN-13 (GTIN-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 this to 0 generates an EPS file without a preview.
-colorspace – RGB (default) or CMYK. The CMYK color model is supported only by PDF and EPS graphic formats.
-designindex – Index of the template within "DesignFile". This is an optional parameter, with a default value of 1.
-silent – Suppresses all messages during execution. This parameter does not take a value.
-tiffres – Only for EPS: Resolution (dpi) for the embedded TIFF preview. The default value is 240; setting this to 0 generates an EPS file without a preview.
-colorspace – RGB (default) or CMYK. The CMYK color model is supported only by PDF and EPS graphic formats.
-designindex – Index of the template within "DesignFile". This is an optional parameter, with a default value of 1.
-silent – Suppresses all messages during execution. This parameter does not take a value.
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 indicates how a program was terminated. Programming languages that can launch external processes typically offer functions or methods to query the Exit Code after a process completes. A calling program can use these functions to handle potential states and errors accordingly.Exit Codes:
0 – Barcode graphic generation completed successfully.
1 – Invalid number of parameters (help is displayed).
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.
21 – CMYK is not supported by the chosen graphic format.
30 – "-designindex" must be an integer between 1 and 20.
31 – "-designindex" exceeds the number of templates in "DesignFile".
40 – "DesignFile" not found.
41 – Error while reading "DesignFile".
50 – "OutputFile" does not have a supported file extension.
51 – Directory for "OutputFile" does not exist.
52 – Error while writing to "OutputFile".
60 – Barcode number cannot be encoded / is invalid.
70 – Insufficient memory, possibly due to an unrealistically high resolution.
For Exit Code 60, the textual error message always specifies the exact reason why the barcode
number cannot be encoded.
1 – Invalid number of parameters (help is displayed).
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.
21 – CMYK is not supported by the chosen graphic format.
30 – "-designindex" must be an integer between 1 and 20.
31 – "-designindex" exceeds the number of templates in "DesignFile".
40 – "DesignFile" not found.
41 – Error while reading "DesignFile".
50 – "OutputFile" does not have a supported file extension.
51 – Directory for "OutputFile" does not exist.
52 – Error while writing to "OutputFile".
60 – Barcode number cannot be encoded / is invalid.
70 – Insufficient memory, possibly due to an unrealistically high resolution.