new Unit()

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");

Methods

equals(obj)

Determines whether this instance and a specified object,
which must also be a Unit object, have the same value.

Parameter

Name Type Optional Description

obj

 

 

The Unit to compare to this instance.

Returns

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.

getDocument()

Gets size value in document units.

getInches()

Gets size value in inches.

getMillimeters()

Gets size value in millimeters.

getPixels()

Gets size value in pixels.

getPoint()

Gets size value in point.

setDocument()

Sets size value in document units.

setInches()

Sets size value in inches.

setMillimeters()

Sets size value in millimeters.

setPixels()

Sets size value in pixels.

setPoint()

Sets size value in point.

toString()

Returns a human-readable string representation of this Unit.

Returns

A string that represents this Unit.