Printer
|
The PrinterUtil type exposes the following members.
Name | Description | |
---|---|---|
ConvertGraphic(String, ZebraImageI, Stream) | Encodes supplied image in either ZPL or CPCL after dithering and resizing. | |
ConvertGraphic(String, ZebraImageI, Int32, Int32, Stream) | Encodes supplied image in either ZPL or CPCL after dithering and resizing. | |
CreateBackup | Create a backup of your printer's settings, alerts, and files. | |
CreateProfile | Create a profile of your printer's settings, alerts, and files for cloning to other printers. | |
DeleteFile | Deletes file(s) from the printer and reports what files were actually removed. | |
DeleteFileReportDeleted | Deletes file(s) from the printer and reports what files were actually removed. | |
Equals | (Inherited from Object) | |
GetCurrentStatus | Returns a new instance of PrinterStatus that can be used to determine the status of a printer. | |
GetHashCode | (Inherited from Object) | |
GetObjectFromPrinter(String, String) | Retrieves a file from the printer's file system and returns the contents of that file as a byte[]. | |
GetObjectFromPrinter(Stream, String, String) | Retrieves a file from the printer's file system and returns the contents of that file as a byte[]. | |
GetObjectFromPrinterViaFtp(String, String, String) | Retrieves a file from the printer's file system and returns the contents of that file as a byte[]. | |
GetObjectFromPrinterViaFtp(Stream, String, String, String) | Retrieves a file from the printer's file system and returns the contents of that file as a byte[]. | |
GetOdometerStatus | Retrieves status of the printer odometer which includes the total print length, head clean counter, label dot length, head new, latch open counter, and both user resettable counters. | |
GetPortStatus | Retrieves a list of currently open tcp ports on the printer. | |
GetPrinterStatus | Retrieves status of the printer which includes any error messages currently set along with the number of labels remaining in queue, number of labels remaining in batch, and whether or not a label is currently being processed. | |
GetSettingsFromPrinter | Retrieve all settings and their attributes from the specified printer. | |
GetType | (Inherited from Object) | |
ListFiles | Retrieves the names of the files which are stored on the device. | |
LoadBackup(String, String) | Takes settings, alerts, and files from a backup, and applies them to a printer. | |
LoadBackup(String, String, Boolean) | Takes settings, alerts, and files from a backup, and applies them to a printer. | |
LoadProfile(String, String, FileDeletionOption) | Takes settings, alerts, and files from a profile, and applies them to a printer. | |
LoadProfile(String, String, FileDeletionOption, Boolean) | Takes settings, alerts, and files from a profile, and applies them to a printer. | |
PrintConfigLabel | Causes the specified printer to print a configuration label. | |
PrintDirectoryLabel | Causes the specified printer to print a directory listing of all the files saved on the printer. | |
PrintNetworkConfigLabel | Causes the specified printer to print a network configuration label. | |
QuickStatus | Retrieves the quick status of the printer. | |
ResetNetwork | Resets the network of the specified printer. | |
ResetPrinter | Resets the specified printer. | |
RestoreNetworkDefaults | Restores the printer's network settings to their factory default configuration. | |
RestorePrinterDefaults | Restores the printer's settings to their factory default configuration. | |
SendContents(String, Stream) | Send contents of data directly to the device specified via connectionString using UTF-8 encoding. | |
SendContents(String, String) | Send contents of data directly to the device specified via connectionString using UTF-8 encoding. | |
SendContents(String, Stream, String) | Send contents of data directly to the device specified via connectionString using encoding. | |
SendContents(String, String, String) | Send contents of data directly to the device specified via connectionString using encoding. | |
SendJSON | Send contents of data directly to the device specified via connectionString using encoding. | |
SetClock | Set the RTC time and date on the printer. | |
StoreFile | Stores the file on the printer at the specified location and name using any required file wrappers. | |
ToString | (Inherited from Object) | |
UpdateFirmware | Update the printer firmware. |
using System; using Zebra.Sdk.Printer; public class PrinterUtilExample { private static string CONNECTION_STRING = "172.30.16.135"; public static void Main(string[] args) { // Create a few files on the printer SendContentsExample(); // List the files just created ListFilesExample(); // Silently delete some of the files DeleteFilesExample(); // List the remaining files ListFilesExample(); // Verbosely delete the rest of the files DeleteFilesVerboseExample(); // List the remaining files ListFilesExample(); } private static void SendContentsExample() { PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST1.ZPL^FO100,100^A0N,30,30^FDZSDK_Test1.zpl^FS^XZ"); PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST2.ZPL^FO100,100^A0N,30,30^FDZSDK_Test2.zpl^FS^XZ"); PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST3.ZPL^FO100,100^A0N,30,30^FDZSDK_Test3.zpl^FS^XZ"); PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST4.ZPL^FO100,100^A0N,30,30^FDZSDK_Test4.zpl^FS^XZ"); PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST11.ZPL^FO100,100^A0N,30,30^FDZSDK_Test11.zpl^FS^XZ"); PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST12.ZPL^FO100,100^A0N,30,30^FDZSDK_Test12.zpl^FS^XZ"); PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST22.ZPL^FO100,100^A0N,30,30^FDZSDK_Test22.zpl^FS^XZ"); PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST33.ZPL^FO100,100^A0N,30,30^FDZSDK_Test33.zpl^FS^XZ"); PrinterUtil.SendContents(CONNECTION_STRING, "^XA^DFR:ZSDK_TEST44.ZPL^FO100,100^A0N,30,30^FDZSDK_Test44.zpl^FS^XZ"); } private static void ListFilesExample() { string[] filesOnE = PrinterUtil.ListFiles(CONNECTION_STRING, "R:ZSDK_TEST*.*"); Console.WriteLine("--- List of Files on R: ---"); foreach (string thisFile in filesOnE) { Console.WriteLine($" - {thisFile}"); } Console.WriteLine("--- End of List ---"); } private static void DeleteFilesExample() { Console.WriteLine("Deleting R:ZSDK_TEST1*.ZPL..."); PrinterUtil.DeleteFile(CONNECTION_STRING, "R:ZSDK_TEST1*.ZPL"); } private static void DeleteFilesVerboseExample() { Console.WriteLine("Verbosely Deleting R:ZSDK_TEST*.ZPL..."); string[] filesDeleted = PrinterUtil.DeleteFileReportDeleted(CONNECTION_STRING, "R:ZSDK_TEST*.ZPL"); foreach (string thisDeletedFile in filesDeleted) { Console.WriteLine($" - {thisDeletedFile} deleted"); } } }