Aspose.Barcode for Python via Java Generation and Recognition API docs

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

Inherits _MwWrapper.

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 document (self)
 Gets size value in document units. More...
 
None document (self, float value)
 Sets size value in document units. More...
 
float inches (self)
 Gets size value in inches. More...
 
None inches (self, float value)
 Sets size value in inches. More...
 
float millimeters (self)
 Gets size value in millimeters. More...
 
None millimeters (self, float value)
 Sets size value in millimeters. More...
 
float pixels (self)
 Gets size value in pixels. More...
 
None pixels (self, float value)
 Sets size value in pixels. More...
 
float point (self)
 Gets size value in point. More...
 
None point (self, float value)
 Sets size value in point. More...
 

Detailed Description

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

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

generator = BarcodeGenerator(EncodeTypes.CODE_128, "123456789")
generator.parameters.barcode.bar_height.millimeters = 10
generator.save(image_path_to_save, 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.

◆ document() [1/2]

float document (   self)

Gets size value in document units.

◆ document() [2/2]

None document (   self,
float  value 
)

Sets size value in document units.

◆ inches() [1/2]

float inches (   self)

Gets size value in inches.

◆ inches() [2/2]

None inches (   self,
float  value 
)

Sets size value in inches.

◆ millimeters() [1/2]

float millimeters (   self)

Gets size value in millimeters.

◆ millimeters() [2/2]

None millimeters (   self,
float  value 
)

Sets size value in millimeters.

◆ pixels() [1/2]

float pixels (   self)

Gets size value in pixels.

◆ pixels() [2/2]

None pixels (   self,
float  value 
)

Sets size value in pixels.

◆ point() [1/2]

float point (   self)

Gets size value in point.

◆ point() [2/2]

None point (   self,
float  value 
)

Sets size value in point.