Unit

Unit class

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

public class Unit : joint.BaseJavaClass

Constructors

NameDescription
Unit(object)Initializes a new instance of the Unit class.

Methods

NameDescription
equals(object)Determines whether this instance and a specified object, which must also be a Unit object, have the same value.
getDocumentGets size value in document units.
getInchesGets size value in inches.
getMillimetersGets size value in millimeters.
getPixelsGets size value in pixels.
getPointGets size value in point.
init
initUnit(object)
setDocument(object)Sets size value in document units.
setInches(object)Sets size value in inches.
setMillimeters(object)Sets size value in millimeters.
setPixels(object)Sets size value in pixels.
setPoint(object)Sets size value in point.
toStringReturns a human-readable string representation of this Unit.

Examples

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

See Also