A class representing a label for TSPL.
More...
|
| | __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.
|
| |
| str | __str__ (self) |
| | Returns the string that can be sent to printer.
|
| |
A class representing a label for TSPL.
This class implements the ILabel protocol and provides functionality for initializing, adding objects and raw content, and describing labels in TSPL.
◆ __init__()
| LabelMaker.TSPL.Label.Label.__init__ |
( |
| self, |
|
|
str | name ) |
Initializes a new instance of the Label class with the specified name.
- Parameters
-
| name | The name of the label. |
- Returns
- A new instance of Label.
◆ __str__()
| str LabelMaker.TSPL.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 in TSPL.
- Returns
- A string description of the Label instance.
◆ add_object()
| LabelMaker.TSPL.Label.Label.add_object |
( |
| self, |
|
|
Union[object, str] | add_object ) |
Adds an object that can be converted to printer language syntax to the label.
- Parameters
-
| add_object | The object to be added to the label. |
Reimplemented from LabelMaker.Interfaces.ILabel.ILabel.
◆ add_raw_content()
| LabelMaker.TSPL.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_content | The raw content to be added to the label. |
Reimplemented from LabelMaker.Interfaces.ILabel.ILabel.
◆ name() [1/2]
| str LabelMaker.TSPL.Label.Label.name |
( |
| self | ) |
|
Gets the name of the label.
- Returns
- The name of the label.
◆ name() [2/2]
| LabelMaker.TSPL.Label.Label.name |
( |
| self, |
|
|
str | name ) |
Sets the name of the label.
- Parameters
-
| name | The new name of the label. |
◆ form
| LabelMaker.TSPL.Label.Label.form = TsplForm(name) |
◆ scale
| LabelMaker.TSPL.Label.Label.scale |
Initial value:= Scale(
units=TSPLScaleUnits.DOT,
horz_resolution=Defaults.printer_resolution().dots_per_inch,
vert_resolution=Defaults.printer_resolution().dots_per_inch
)
The documentation for this class was generated from the following file:
- /Users/bob_huang/Documents/Project/UniPRTSDK_python/LabelMaker/TSPL/Label.py