Aspose.BarCode for Python via Java  24.11
Aspose.Barcode for Python via Java Generation and Recognition API docs
Unit Class Reference

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

Inherits BaseJavaClass.

Public Member Functions

None __init__ (self, Union[Unit, Any] source)
 
bool __eq__ (self, Optional[Unit] other)
 Determines whether this instance and a specified object, which must also be a Unit object, have the same value. More...
 
int __hash__ (self)
 Returns the hash code for the current instance. More...
 
str __str__ (self)
 Returns a human-readable string representation of this Unit. More...
 
float getDocument (self)
 Gets size value in document units. More...
 
float getInches (self)
 Gets size value in inches. More...
 
float getMillimeters (self)
 Gets size value in millimeters. More...
 
float getPixels (self)
 Gets size value in pixels. More...
 
float getPoint (self)
 Gets size value in point. More...
 
None init (self)
 
None setDocument (self, float value)
 Sets size value in document units. More...
 
None setInches (self, float value)
 Sets size value in inches. More...
 
None setMillimeters (self, float value)
 Sets size value in millimeters. More...
 
None setPixels (self, float value)
 Sets size value in pixels. More...
 
None setPoint (self, float value)
 Sets size value in point. More...
 
- Public Member Functions inherited from BaseJavaClass
None __init__ (self, javaClass)
 
def getJavaClass (self)
 
str getJavaClassName (self)
 
bool isNull (self)
 
None printJavaClassName (self)
 
None setJavaClass (self, javaClass)
 

Additional Inherited Members

- Public Attributes inherited from BaseJavaClass
 javaClass
 
 javaClassName
 

Detailed Description

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

This sample shows how to create and save a BarCode image.

generator = Generation.BarcodeGenerator(Generation.EncodeTypes.CODE_128, "123456789")
generator.getParameters().getBarcode().getBarHeight().setMillimeters(10)
generator.save(self.image_path_to_save, Generation.BarCodeImageFormat.PNG)

Constructor & Destructor Documentation

◆ __init__()

None __init__ (   self,
Union[Unit, Any]  source 
)

Member Function Documentation

◆ __eq__()

bool __eq__ (   self,
Optional[Unit other 
)

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

Parameters
otherThe Unit to compare to this instance.
Returns
: True if other is a Unit and its value is the same as this instance, otherwise False. If other is None, the method returns false.

◆ __hash__()

int __hash__ (   self)

Returns the hash code for the current instance.

Returns
A hash code for the current object.

◆ __str__()

str __str__ (   self)

Returns a human-readable string representation of this Unit.

Returns
A string that represents this Unit.

◆ getDocument()

float getDocument (   self)

Gets size value in document units.

◆ getInches()

float getInches (   self)

Gets size value in inches.

◆ getMillimeters()

float getMillimeters (   self)

Gets size value in millimeters.

◆ getPixels()

float getPixels (   self)

Gets size value in pixels.

◆ getPoint()

float getPoint (   self)

Gets size value in point.

◆ init()

None init (   self)

Reimplemented from BaseJavaClass.

◆ setDocument()

None setDocument (   self,
float  value 
)

Sets size value in document units.

◆ setInches()

None setInches (   self,
float  value 
)

Sets size value in inches.

◆ setMillimeters()

None setMillimeters (   self,
float  value 
)

Sets size value in millimeters.

◆ setPixels()

None setPixels (   self,
float  value 
)

Sets size value in pixels.

◆ setPoint()

None setPoint (   self,
float  value 
)

Sets size value in point.