Unit

Unit

Specifies the size value in different units (Pixel, Inches, etc.).

Constructor

new Unit()

Source:
Example
//This sample shows how to create and save a BarCode image.
   let generator = new BarcodeGenerator(EncodeTypes.CODE_128);
   generator.getParameters().getBarcode().getBarHeight().setMillimeters(10);
   generator.save("test.png", BarcodeImageFormat.PNG);

Methods

equals(obj)

Determines whether this instance and a specified object,
which must also be a Unit object, have the same value.
Parameters:
Name Type Description
obj The Unit to compare to this instance.
Returns:
Type Description
true if obj is a Unit and its value is the same as this instance; otherwise, false. If obj is null, the method returns false.
Source:

getDocument()

Gets size value in document units.
Source:

getInches()

Gets size value in inches.
Source:

getMillimeters()

Gets size value in millimeters.
Source:

getPixels()

Gets size value in pixels.
Source:

getPoint()

Gets size value in point.
Source:

setDocument()

Sets size value in document units.
Source:

setInches()

Sets size value in inches.
Source:

setMillimeters()

Sets size value in millimeters.
Source:

setPixels()

Sets size value in pixels.
Source:

setPoint()

Sets size value in point.
Source:

toString()

Returns a human-readable string representation of this Unit.
Returns:
Type Description
A string that represents this Unit.
Source: