UniPRT SDK  v1.0.0.0
com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm Class Reference

Provide support for TSC Print Language (TSPL) form/label creation. More...

Public Member Functions

 TsplForm (String formName)
 Create form with a given name. More...
 
String GetName ()
 Change Form name. More...
 
void SetName (String name)
 
boolean IsDeleteAfterUse ()
 Not Supported. More...
 
void SetDeleteAfterUse (boolean deleteAfterUse)
 
void RawContent (String rawContent)
 Raw content added to form for cases where custom content needs to be added. More...
 
void Scale (TSPL.SCALE_UNITS units, int horzRes, int vertRes)
 Change the scaling used for object positioning within form. More...
 
void Box (int lineThickness, int startRow, int startCol, int endRow, int endCol)
 Add box. More...
 
void Line (int lineThickness, int startRow, int startCol, int endRow, int endCol)
 Add Line: Vertical, Horizontal, Diagonal. More...
 
void Text (int startRow, int startCol, int vertExpand, int horzExpand, String data)
 Add Text. More...
 
void Barcode_1D (TSPL.Barcode_Type1D bcdType, int startRow, int startCol, String bcdData)
 Add 1D barcode using default barcode settings. More...
 
void Barcode_1D (Barcode_1D_Properties bcdSetup, int startRow, int startCol, String bcdData)
 Add 1D barcode with non-default settings passed in. More...
 
void Barcode_2D (TSPL.Barcode_Type2D bcdType, int startRow, int startCol, String bcdData)
 Add 2D barcode using default barcode settings. More...
 
void Barcode_2D (Barcode_2D_Properties bcdSetup, int startRow, int startCol, String bcdData)
 Add 2D barcode with non-default settings passed in. More...
 
void Rfid_Write (Rfid_WriteProperties writeProps, Rfid_WriteBitField bitField)
 For writes where only one bit field will be written. More...
 
void Rfid_Write (TSPL.Rfid_MemBlock memBank, TSPL.Rfid_Format dataFormat, int bitCount, String data)
 For simple writes where only one bit field will be written. More...
 
void AddTsplObject (Object tsplObject)
 Add object that can be converted to TSPL syntax. More...
 
void Rfid_Verify (Rfid_ReadProperties readProps, Rfid_ReadBitField readBitField)
 Read and send back to host the contents read. More...
 
String toString ()
 

Private Member Functions

StringBuilder GetAsString ()
 

Private Attributes

List< Object > tsplObjects = new ArrayList<>()
 
String name
 
boolean deleteAfterUse = true
 

Detailed Description

Provide support for TSC Print Language (TSPL) form/label creation.

Note when positioning objects, the origin is the upper left of a form/label. This means that when positioning objects in terms of row (vertical) and column (horizontal), placement of objects within form/label move down when row increases and move right when column increases.

Constructor & Destructor Documentation

◆ TsplForm()

com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.TsplForm ( String  formName)

Create form with a given name.

Member Function Documentation

◆ AddTsplObject()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.AddTsplObject ( Object  tsplObject)

Add object that can be converted to TSPL syntax.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

Referenced by com.UniPRT.Sdk.LabelMaker.TSPL.Label.AddObject().

◆ Barcode_1D() [1/2]

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Barcode_1D ( Barcode_1D_Properties  bcdSetup,
int  startRow,
int  startCol,
String  bcdData 
)

Add 1D barcode with non-default settings passed in.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ Barcode_1D() [2/2]

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Barcode_1D ( TSPL.Barcode_Type1D  bcdType,
int  startRow,
int  startCol,
String  bcdData 
)

Add 1D barcode using default barcode settings.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ Barcode_2D() [1/2]

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Barcode_2D ( Barcode_2D_Properties  bcdSetup,
int  startRow,
int  startCol,
String  bcdData 
)

Add 2D barcode with non-default settings passed in.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ Barcode_2D() [2/2]

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Barcode_2D ( TSPL.Barcode_Type2D  bcdType,
int  startRow,
int  startCol,
String  bcdData 
)

Add 2D barcode using default barcode settings.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ Box()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Box ( int  lineThickness,
int  startRow,
int  startCol,
int  endRow,
int  endCol 
)

Add box.

Start/end positions relative to form/label origin which is the upper left.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ GetAsString()

◆ GetName()

String com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.GetName ( )

◆ IsDeleteAfterUse()

boolean com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.IsDeleteAfterUse ( )

◆ Line()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Line ( int  lineThickness,
int  startRow,
int  startCol,
int  endRow,
int  endCol 
)

Add Line: Vertical, Horizontal, Diagonal.

Start/end positions relative to form/label origin which is the upper left. Vertical Lines: start column = ending column Horizontal Lines: start row = ending row Diagonal Lines: start column != ending column, start row != ending row

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ RawContent()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.RawContent ( String  rawContent)

Raw content added to form for cases where custom content needs to be added.

Adding raw content allows adding of PGL commands or other features that may not be available. No formatting of content is done. Caller responsible for making sure content follows PGL syntax.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TSPL.LINE_TERMINATOR, and com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

Referenced by com.UniPRT.Sdk.LabelMaker.TSPL.Label.AddRawContent().

◆ Rfid_Verify()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Rfid_Verify ( Rfid_ReadProperties  readProps,
Rfid_ReadBitField  readBitField 
)

Read and send back to host the contents read.

Printer must be configured to send data back to host. And, host must be listening for data at the appropriate communication port from printer. e.g. Status port 3002, or management port 3007, or data port

Todo:
What about complex verify where multiple fields need to be sent to host? Is there any performance issue if using multiple verify requests for every field desired?

References com.UniPRT.Sdk.LabelMaker.TsplLib.Rfid_ReadBitField.GetDataFormat(), com.UniPRT.Sdk.LabelMaker.TsplLib.Rfid_ReadBitField.GetFieldTag(), com.UniPRT.Sdk.LabelMaker.TsplLib.Verify.SetFieldTag(), com.UniPRT.Sdk.LabelMaker.TsplLib.Verify.SetReportFormat(), and com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ Rfid_Write() [1/2]

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Rfid_Write ( Rfid_WriteProperties  writeProps,
Rfid_WriteBitField  bitField 
)

For writes where only one bit field will be written.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ Rfid_Write() [2/2]

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Rfid_Write ( TSPL.Rfid_MemBlock  memBank,
TSPL.Rfid_Format  dataFormat,
int  bitCount,
String  data 
)

For simple writes where only one bit field will be written.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ Scale()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Scale ( TSPL.SCALE_UNITS  units,
int  horzRes,
int  vertRes 
)

Change the scaling used for object positioning within form.

Note that although scaling can change to make positioning of objects easier, it does not affect the printing of the objects. Default scaling is 300 dpi horizontal, 300 dpi vertical.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ SetDeleteAfterUse()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.SetDeleteAfterUse ( boolean  deleteAfterUse)

◆ SetName()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.SetName ( String  name)

◆ Text()

void com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.Text ( int  startRow,
int  startCol,
int  vertExpand,
int  horzExpand,
String  data 
)

Add Text.

Start/end positions relative to form/label origin which is the upper left. Vertical and horizontal expansion are used to adjust text height/width. 0 values for no expansion.

References com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.tsplObjects.

◆ toString()

String com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.toString ( )

Member Data Documentation

◆ deleteAfterUse

boolean com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.deleteAfterUse = true
private

◆ name

String com.UniPRT.Sdk.LabelMaker.TsplLib.TsplForm.name
private

◆ tsplObjects


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