Class PrintUtils
It specifies printing jobs that are not directly related to label printing but printer commands.
Inheritance
Inherited Members
Namespace:Neodynamic.SDK.Printing
Assembly:Neodynamic.SDK.ThermalLabel.dll
Syntax
public class PrintUtils
Properties
PrinterSettings
Gets or sets information about the thermal printer used for printing.
Declaration
public static PrinterSettings PrinterSettings { get; set; }
Property Value
Type | Description |
---|---|
PrinterSettings |
Methods
AutoSetLabelLength()
It automatically sets the label length. Depending on the size of the label, the printer feeds one or more blank labels.
Declaration
public static void AutoSetLabelLength()
CopyObject(String, String)
It is used to copy an object or group of objects from one storage device to another. It is similar to the copy function used in PCs.
Declaration
public static void CopyObject(string srcObjectInfo, string destObjectInfo)
Parameters
Type | Name | Description |
---|---|---|
System.String | srcObjectInfo | The info of the stored object which will be copied. The info includes the printer's memory device where the object is stored as well as the object name and extension. The asterisk (*) character can be used as a wildcard allowing you to easily copy a selected group of objects. |
System.String | destObjectInfo | The info for the destination object. The info includes the printer's memory device where the object will be stored as well as the object name and extension. The asterisk (*) character can be used as a wildcard. |
Remarks
- If the destination device does not have enough free space to store the object being copied, the task is canceled.
- Zebra files (Z:.) cannot be transferred. These files are copyrighted by Zebra Technologies.
CutLabel()
It cuts the label when the printer is in the Delayed Cutter PRINT MODE.
Declaration
public static void CutLabel()
DeleteObject(String)
It deletes objects, graphics, fonts, and stored formats from printer's storage areas. Objects can be deleted selectively or in groups.
Declaration
public static void DeleteObject(string objectInfo)
Parameters
Type | Name | Description |
---|---|---|
System.String | objectInfo | The object info to be deleted/removed. The info includes the printer's memory device where the object is stored as well as the object name and extension. The asterisk (*) character can be used as a wildcard allowing you to easily delete a selected group of objects. |
ExecuteCommand(String)
It sends the specified commands to the printer.
Declaration
public static void ExecuteCommand(string command)
Parameters
Type | Name | Description |
---|---|---|
System.String | command | The ZPL or EPL commands. |
ExecuteCommand(String, PrinterSettings)
It sends the specified commands to the printer.
Declaration
public static void ExecuteCommand(string command, PrinterSettings printerSettings)
Parameters
Type | Name | Description |
---|---|---|
System.String | command | The ZPL or EPL commands. |
PrinterSettings | printerSettings | Information about the thermal printer used for printing. |
ExecuteCommand(String, Encoding)
It sends the specified commands to the printer.
Declaration
public static void ExecuteCommand(string command, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.String | command | The ZPL or EPL commands. |
System.Text.Encoding | encoding | The codepage or encoding which the commands string is encoded in. |
ExecuteCommand(String, Encoding, PrinterSettings)
It sends the specified commands to the printer.
Declaration
public static void ExecuteCommand(string command, Encoding encoding, PrinterSettings printerSettings)
Parameters
Type | Name | Description |
---|---|---|
System.String | command | The ZPL or EPL commands. |
System.Text.Encoding | encoding | The codepage or encoding which the commands string is encoded in. |
PrinterSettings | printerSettings | Information about the thermal printer used for printing. |
PausePrinting()
It stops printing after the current label is complete (if one is printing) and places the printer in Pause Mode.
Declaration
public static void PausePrinting()
Remarks
The effect of this method is not immediate. Therefore, several labels might print before a pause is performed. The operation is identical to pressing PAUSE on the control panel of the printer. The printer remains paused until PAUSE is pressed or a call to "StartPrinting" method.
PrintConfiguration()
It prints the printer configuration label. The printer configuration label contains information about the printer setup, such as sensor type, network ID, ZPL mode, firmware version, and descriptive data on the R:, E:, B:, and A: devices.
Declaration
public static void PrintConfiguration()
PrintDirectory(String)
It prints a label listing barcodes, objects stored in DRAM, or fonts.
Declaration
public static void PrintDirectory(string directoryInfo)
Parameters
Type | Name | Description |
---|---|---|
System.String | directoryInfo | The directory info. It includes the printer's memory device, object name and extensions. Wildcard characters like question mark and asterisk can be used. For example, "R:." will print all objects stored in Printer DRAM memory. |
Remarks
This method lets you to print a label listing barcodes, objects stored in DRAM, or fonts.
- For barcodes, the list shows the name of the bar code. - For fonts, the list shows the name of the font, the alphanumeric character identifier, and size. - For objects stored in DRAM, the list shows the name of the object, extension, size, and option flags.
The different drives of a Zebra thermal printer are the following: - R: Printer DRAM Library - B: Optional Memory (A card or factory installed) - E: Flash memory - A: Compact flash memory - Z: Internal ZPL II stored object library (Read-only)
The following is a list of commonly used object extensions found in a Zebra thermal printer: - .FNT: Font objects - .BAR: Barcode objects - .GRF: Graphic objects in Zebra image format - .PNG: Graphic objects in Portable Network Graphics (PNG) format. - * (asterik): For all objects
ResetPrinter()
It resets all of the printer's internal software, performs a power-on self-test (POST), clears the buffer and DRAM, and resets communication parameters and default values. This method performs the same function as a manual power-on reset.
Declaration
public static void ResetPrinter()
SetDarkness(Double)
It adjusts the darkness relative to the current darkness setting.
Declaration
public static void SetDarkness(double darkness)
Parameters
Type | Name | Description |
---|---|---|
System.Double | darkness | The darkness level based on the printer type. See Remarks below. |
Remarks
- For ZPL printers: The darkness level which must range from -30 to 30, depending on current value of printer settings. NOTE: The darkness level for the XiIIIPlus printer must be 0 to 30 in increments of 0.1.
- For EPL printers: The darkness level must range from 0 to 15.
- For Intermect/Fingerprint printers: The darkness level must range from -10 to 10 in steps of 2.
SetMediaTracking(MediaTracking)
It sets the type of media used (continuous or non-continuous) for purposes of tracking.
Declaration
public static void SetMediaTracking(MediaTracking mediaTracking)
Parameters
Type | Name | Description |
---|---|---|
MediaTracking | mediaTracking | The media to use (continuous or non-continuous) for purposes of tracking. |
Remarks
The types of media can be categorized as follows:
- Continuous Media: this media has no physical characteristic (web, notch, perforation, mark, et cetera) to separate labels. The Label length is determined by the height property of a ThermalLabel object. - Non-continuous Media: this media has some type of physical characteristic (web, notch, perforation, mark, et cetera) to separate the labels.
SetMediaType(MediaType)
It selects the type of media being used (Thermal Transfer or Direct Thermal) in the printer.
Declaration
public static void SetMediaType(MediaType mediaType)
Parameters
Type | Name | Description |
---|---|---|
MediaType | mediaType | The type of media to use for printing. |
SetPrinterFactoryConfiguration()
It reloads the printer's factory configuration.
Declaration
public static void SetPrinterFactoryConfiguration()
SetPrintMode(PrintMode)
It determines the action the printer takes after a label or group of labels has printed.
Declaration
public static void SetPrintMode(PrintMode printMode)
Parameters
Type | Name | Description |
---|---|---|
PrintMode | printMode | The print mode. Be sure to select the appropriate value for the print mode being used to avoid unexpected results. Note that not all printers support all options. Please refer to the printer user manual for further details. |
StartPrinting()
It causes a printer in Pause Mode to resume printing.
Declaration
public static void StartPrinting()
Remarks
The operation is identical to pressing PAUSE on the control panel of the printer when the printer is already in Pause Mode.
UploadUnboundedTrueTypeFont(Byte[], String)
It uploads an Unbounded or Large True Type Font (a font which has more than 256 printable characters) to the printer's storage devices.
Declaration
public static void UploadUnboundedTrueTypeFont(byte[] ttfBinaryContent, string printerFontName)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | ttfBinaryContent | The Unbounded or Large True Type Font file binary content. |
System.String | printerFontName | The complete name for the destination font (including the drive location and name, for ZPL e.g. "B:ARIAL"; for Fingerprint e.g. "c:ARIAL"). IMPORTANT: The name must be 1 to 8 alphanumeric characters long. |
UploadUnboundedTrueTypeFont(String, String)
It uploads an Unbounded or Large True Type Font (a font which has more than 256 printable characters) to the printer's storage devices.
Declaration
public static void UploadUnboundedTrueTypeFont(string ttfFilePath, string printerFontName)
Parameters
Type | Name | Description |
---|---|---|
System.String | ttfFilePath | The Unbounded or Large True Type Font file path. |
System.String | printerFontName | The complete name for the destination font (including the drive location and name, for ZPL e.g. "B:ARIAL"; for Fingerprint e.g. "c:ARIAL"). IMPORTANT: The name must be 1 to 8 alphanumeric characters long. |