UniPRT SDK v2.0.0.0
 
Loading...
Searching...
No Matches
LabelMaker.PGL.Label.Label Class Reference

Represents a label that can be formatted for printing. More...

Inheritance diagram for LabelMaker.PGL.Label.Label:
LabelMaker.Interfaces.ILabel.ILabel

Public Member Functions

 __init__ (self, str name)
 Initializes a new instance of the Label class with the specified name.
 
str name (self)
 Gets the name of the label.
 
 name (self, str name)
 Sets the name of the label.
 
 add_object (self, Union[object, str] add_object)
 Adds an object that can be converted to printer language syntax to the label.
 
 add_raw_content (self, str raw_content)
 Adds raw content to the label for cases where custom content needs to be added.
 
str __str__ (self)
 Returns a string that can be sent to the printer.
 
- Public Member Functions inherited from LabelMaker.Interfaces.ILabel.ILabel
str __str__ (self)
 Returns the string that can be sent to printer.
 

Public Attributes

 form = PglForm(name=name)
 
 scale
 

Detailed Description

Represents a label that can be formatted for printing.

This class provides functionality for creating and managing a label with specified settings, allowing the addition of objects and raw content to be formatted for printer language syntax.

Constructor & Destructor Documentation

◆ __init__()

LabelMaker.PGL.Label.Label.__init__ ( self,
str name )

Initializes a new instance of the Label class with the specified name.

Parameters
nameThe name of the label.

Member Function Documentation

◆ __str__()

str LabelMaker.PGL.Label.Label.__str__ ( self)

Returns a string that can be sent to the printer.

This method generates a string representation of the Label instance that is formatted and ready to be sent to a printer. The string includes all the necessary commands and data required for printing.

Returns
A string description of the Label instance.

◆ add_object()

LabelMaker.PGL.Label.Label.add_object ( self,
Union[object, str] add_object )

Adds an object that can be converted to printer language syntax to the label.

This method allows for adding any object that can be formatted into the label's printer language.

Parameters
add_objectThe object to be added to the label.

Reimplemented from LabelMaker.Interfaces.ILabel.ILabel.

◆ add_raw_content()

LabelMaker.PGL.Label.Label.add_raw_content ( self,
str raw_content )

Adds raw content to the label for cases where custom content needs to be added.

Adding raw content allows the addition of printer language commands or other features that may not be available. No formatting of the content is done; the caller is responsible for making sure the content follows printer language syntax.

Parameters
raw_contentThe raw content to be added to the label.

Reimplemented from LabelMaker.Interfaces.ILabel.ILabel.

◆ name() [1/2]

str LabelMaker.PGL.Label.Label.name ( self)

Gets the name of the label.

Returns
The name of the label.

◆ name() [2/2]

LabelMaker.PGL.Label.Label.name ( self,
str name )

Sets the name of the label.

Parameters
nameThe new name of the label.

Member Data Documentation

◆ form

LabelMaker.PGL.Label.Label.form = PglForm(name=name)

◆ scale

LabelMaker.PGL.Label.Label.scale
Initial value:
= Scale(
units=PGLScaleUnits.DOT,
horz_resolution=int(Defaults.printer_resolution().dots_per_inch),
vert_resolution=int(Defaults.printer_resolution().dots_per_inch),
)

The documentation for this class was generated from the following file: