Set Height of the Bars in the Barcode Image

[ ]
Figure: A barcode with different bar heights

Graphics Unit To change the measuring unit of the bar height, use any of the following:

Measuring Units Description
setDocument() Specifies the document unit (1/300 inch) as the unit of measure
setInches() Specifies the inch as the unit of measure
setMillimeters() Specifies the millimeter as the unit of measure
setPixels() Specifies a device pixel as the unit of measure
setPoints() Specifies a printer’s point (1/72 inch) as the unit of measure
The image below shows the output from the code in this example.
Figure: The output barcode image

In two dimensional barcodes, set getxDimension() decides each module’s width.

xDimension = 6
The following code snippet shows the implementation of xDimension.