public interface FormatUtil
Modifier and Type | Method and Description |
---|---|
FieldDescriptionData[] |
getVariableFields(String formatString)
Returns a list of descriptors of the variable fields in this format.
|
void |
printStoredFormat(String formatPathOnPrinter,
java.util.Map<Integer,String> vars)
Prints a stored format on the printer, filling in the fields specified by the Map.
|
void |
printStoredFormat(String formatPathOnPrinter,
java.util.Map<Integer,String> vars,
String encoding)
Prints a stored format on the printer, filling in the fields specified by the Map.
|
void |
printStoredFormat(String formatPathOnPrinter,
String[] vars)
Prints a stored format on the printer, filling in the fields specified by the array.
|
void |
printStoredFormat(String formatPathOnPrinter,
String[] vars,
String encoding)
Prints a stored format on the printer, filling in the fields specified by the array.
|
void |
retrieveFormatFromPrinter(java.io.OutputStream formatData,
String formatPathOnPrinter)
Retrieves a format from the printer.
|
byte[] |
retrieveFormatFromPrinter(String formatPathOnPrinter)
Retrieves a format from the printer.
|
byte[] retrieveFormatFromPrinter(String formatPathOnPrinter) throws ConnectionException
.ZPL
files are supported. On a
CPCL printer, only .FMT
and .LBL
files are supported.formatPathOnPrinter
- the location of the file on the printer (e.g. "E:FORMAT.ZPL").ConnectionException
- if there is an issue communicating with the printer (e.g. the connection is not
open).void retrieveFormatFromPrinter(java.io.OutputStream formatData, String formatPathOnPrinter) throws ConnectionException
.ZPL
files are supported. On a
CPCL printer, only .FMT
and .LBL
files are supported.formatData
- The format.formatPathOnPrinter
- the location of the file on the printer (e.g. "E:FORMAT.ZPL").ConnectionException
- if there is an issue communicating with the printer (e.g. the connection is not
open).void printStoredFormat(String formatPathOnPrinter, String[] vars) throws ConnectionException
encoding
type. On a LinkOS/ZPL printer, only ZPL formats
are supported. On a CPCL printer, only CPCL formats are supported.formatPathOnPrinter
- the name of the format on the printer, including the extension (e.g. "E:FORMAT.ZPL").vars
- an array of strings representing the data to fill into the format. For LinkOS/ZPL printer formats,
index 0 of the array corresponds to field number 2 (^FN2). For CPCL printer formats, the variables are passed in
the order that they are found in the format.ConnectionException
- if an I/O error occurs.void printStoredFormat(String formatPathOnPrinter, String[] vars, String encoding) throws ConnectionException, java.io.UnsupportedEncodingException
encoding
type. eg. UTF-8. On a LinkOS/ZPL printer, only
ZPL formats are supported. On a CPCL printer, only CPCL formats are supported.formatPathOnPrinter
- the location of the file on the printer (e.g. "E:FORMAT.ZPL").vars
- an array of strings representing the data to fill into the format. For LinkOS/ZPL printer formats,
index 0 of the array corresponds to field number 2 (^FN2). For CPCL printer formats, the variables are passed in
the order that they are found in the format.encoding
- a character-encoding name (eg. UTF-8).ConnectionException
- if an I/O error occurs.java.io.UnsupportedEncodingException
- if the encoding is not supported.void printStoredFormat(String formatPathOnPrinter, java.util.Map<Integer,String> vars) throws ConnectionException
encoding
type. On a LinkOS/ZPL printer, only ZPL formats
are supported. On a CPCL printer, only CPCL formats are supported.formatPathOnPrinter
- the location of the file on the printer (e.g. "E:FORMAT.ZPL").vars
- a map which contains the key/value pairs for the stored format. For LinkOS/ZPL printer formats, the
key number should correspond directly to the number of the field in the format. For CPCL printer formats, the
values will be passed in ascending numerical order.ConnectionException
- if an I/O error occurs.void printStoredFormat(String formatPathOnPrinter, java.util.Map<Integer,String> vars, String encoding) throws ConnectionException, java.io.UnsupportedEncodingException
encoding
type. eg. UTF-8. On a LinkOS/ZPL printer, only
ZPL formats are supported. On a CPCL printer, only CPCL formats are supported.formatPathOnPrinter
- the location of the file on the printer (e.g. "E:FORMAT.ZPL").vars
- a map which contains the key/value pairs for the stored format. For LinkOS/ZPL printer formats, the
key number should correspond directly to the number of the field in the format. For CPCL printer formats, the
values will be passed in ascending numerical order.encoding
- a character-encoding name (e.g. UTF-8).ConnectionException
- if an I/O error occurs.java.io.UnsupportedEncodingException
- if the encoding is not supported.FieldDescriptionData[] getVariableFields(String formatString)
formatString
- the contents of the recalled format.FieldDescriptionData
for an example of how variable fields look.FieldDescriptionData
© 2017 ZIH Corp. All Rights Reserved.