BarcodeSettings

Inheritance: java.lang.Object

public class BarcodeSettings

Represents a set of settings controlling barcode generation while assembling a document.

Methods

Method Description
getGraphicsUnit() Gets a graphics unit used to measure getBaseXDimension() / setBaseXDimension(float) and getBaseYDimension() / setBaseYDimension(float).
setGraphicsUnit(int value) Sets a graphics unit used to measure getBaseXDimension() / setBaseXDimension(float) and getBaseYDimension() / setBaseYDimension(float).
getBaseXDimension() Gets a base x-dimension, that is, the smallest width of the unit of barcode bars and spaces.
setBaseXDimension(float value) Sets a base x-dimension, that is, the smallest width of the unit of barcode bars and spaces.
getBaseYDimension() Gets a base y-dimension, that is, the smallest height of the unit of 2D barcode modules.
setBaseYDimension(float value) Sets a base y-dimension, that is, the smallest height of the unit of 2D barcode modules.
getResolution() Gets the horizontal and vertical resolution of a barcode image being generated.
getXResolution() Gets the horizontal resolution of a barcode image being generated.
getYResolution() Gets the vertical resolution of a barcode image being generated.
getUseAutoCorrection() Gets a value indicating whether an invalid barcode value should be corrected automatically (if possible) to fit the barcode’s specification or an exception should be thrown to indicate the error.
setUseAutoCorrection(boolean value) Sets a value indicating whether an invalid barcode value should be corrected automatically (if possible) to fit the barcode’s specification or an exception should be thrown to indicate the error.

getGraphicsUnit()

public int getGraphicsUnit()

Gets a graphics unit used to measure getBaseXDimension() / setBaseXDimension(float) and getBaseYDimension() / setBaseYDimension(float). The default value is GraphicsUnit.MILLIMETER.

Returns: int - A graphics unit used to measure getBaseXDimension() / setBaseXDimension(float) and getBaseYDimension() / setBaseYDimension(float). The returned value is one of GraphicsUnit constants.

setGraphicsUnit(int value)

public void setGraphicsUnit(int value)

Sets a graphics unit used to measure getBaseXDimension() / setBaseXDimension(float) and getBaseYDimension() / setBaseYDimension(float). The default value is GraphicsUnit.MILLIMETER.

Parameters:

Parameter Type Description
value int A graphics unit used to measure getBaseXDimension() / setBaseXDimension(float) and getBaseYDimension() / setBaseYDimension(float). The value must be one of GraphicsUnit constants.

getBaseXDimension()

public float getBaseXDimension()

Gets a base x-dimension, that is, the smallest width of the unit of barcode bars and spaces. Measured in getGraphicsUnit() / setGraphicsUnit(int). When barcode scaling is applied through a template, an actual x-dimension is calculated upon the base x-dimension and a scaling factor.

Returns: float - A base x-dimension, that is, the smallest width of the unit of barcode bars and spaces.

setBaseXDimension(float value)

public void setBaseXDimension(float value)

Sets a base x-dimension, that is, the smallest width of the unit of barcode bars and spaces. Measured in getGraphicsUnit() / setGraphicsUnit(int). When barcode scaling is applied through a template, an actual x-dimension is calculated upon the base x-dimension and a scaling factor.

Parameters:

Parameter Type Description
value float A base x-dimension, that is, the smallest width of the unit of barcode bars and spaces.

getBaseYDimension()

public float getBaseYDimension()

Gets a base y-dimension, that is, the smallest height of the unit of 2D barcode modules. Measured in getGraphicsUnit() / setGraphicsUnit(int).

Barcodes of some types (such as data matrix) may ignore an y-dimension and use an x-dimension for both width and height units.

When barcode scaling is applied through a template, an actual y-dimension is calculated upon the base y-dimension and a scaling factor.

Returns: float - A base y-dimension, that is, the smallest height of the unit of 2D barcode modules.

setBaseYDimension(float value)

public void setBaseYDimension(float value)

Sets a base y-dimension, that is, the smallest height of the unit of 2D barcode modules. Measured in getGraphicsUnit() / setGraphicsUnit(int).

Barcodes of some types (such as data matrix) may ignore an y-dimension and use an x-dimension for both width and height units.

When barcode scaling is applied through a template, an actual y-dimension is calculated upon the base y-dimension and a scaling factor.

Parameters:

Parameter Type Description
value float A base y-dimension, that is, the smallest height of the unit of 2D barcode modules.

getResolution()

public float getResolution()

Gets the horizontal and vertical resolution of a barcode image being generated. Measured in dots per inch. The default value is 96.

Returns: float - The horizontal and vertical resolution of a barcode image being generated.

getXResolution()

public float getXResolution()

Gets the horizontal resolution of a barcode image being generated. Measured in dots per inch. The default value is 96.

Returns: float - The horizontal resolution of a barcode image being generated.

getYResolution()

public float getYResolution()

Gets the vertical resolution of a barcode image being generated. Measured in dots per inch. The default value is 96.

Returns: float - The vertical resolution of a barcode image being generated.

getUseAutoCorrection()

public boolean getUseAutoCorrection()

Gets a value indicating whether an invalid barcode value should be corrected automatically (if possible) to fit the barcode’s specification or an exception should be thrown to indicate the error. The default value is true. The auto-correction is not possible for Databar barcodes.

Returns: boolean - A value indicating whether an invalid barcode value should be corrected automatically (if possible) to fit the barcode’s specification or an exception should be thrown to indicate the error.

setUseAutoCorrection(boolean value)

public void setUseAutoCorrection(boolean value)

Sets a value indicating whether an invalid barcode value should be corrected automatically (if possible) to fit the barcode’s specification or an exception should be thrown to indicate the error. The default value is true. The auto-correction is not possible for Databar barcodes.

Parameters:

Parameter Type Description
value boolean A value indicating whether an invalid barcode value should be corrected automatically (if possible) to fit the barcode’s specification or an exception should be thrown to indicate the error.