saveSimpleImage / saveImage Method

Generates a barcode image and saves it to a file. saveSimpleImage is lightweight and is the recommended method for saving an image. saveImage uses more resources and requires your web server to run in graphics mode (e.g. X-Window) but it allows you to use the fonts of your choice.

Syntax

public void saveSimpleImage(int imageType, int width, int height, 
	boolean isBarWidth, String pathFile) 
	throws Exception

public void saveImage(int imageType, int width, int height, 
	boolean isBarWidth, String pathFile) 
	throws Exception

Parameters

imageType

Indicates the image format:

width

Specifies either the desired width for the entire barcode or the width of the thinnest bar, in screen pixels, depending on the value of the isBarWidth parameter. Typically, it's more convenient to specify the width of the thinnest bar rather than that of the entire barcode.

height

Specifies the height of the barcode in screen pixels.

isBarWidth

If true, it indicates that the width parameter is the width of the tinnest bar; otherwise, it's the width of the entire barcode.

filePath

Specifies the file path to which the barcode image is to be saved.

Remarks

If the file already exists, it's overwritten; otherwise, a new file is created.