Set Height of the Bars in the Barcode Image
Contents
[
Hide
]
To control the height of a barcode’s bars, Aspose.BarCode’s BarcodeGenerator has the getBarHeight() method. The getBarHeight() method takes a float value to set the bar height and its measuring unit is millimeter by default.
![]() |
---|
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. |