Defines functions used for creating and applying profiles to a Zebra printer.
Namespace: Zebra.Sdk.PrinterAssembly: SdkApi.Core (in SdkApi.Core.dll) Version: 3.0.3271
Syntax public interface ProfileUtil
Public Interface ProfileUtil
public interface class ProfileUtil
The ProfileUtil type exposes the following members.
Methods | Name | Description |
---|
| CreateBackup |
Save a backup of your printer's settings, alerts, and files for later restoration.
|
| CreateProfile(Stream) |
Create a profile of your printer's settings, alerts, and files for cloning to other printers.
|
| CreateProfile(String) |
Create a profile of your printer's settings, alerts, and files for cloning to other printers.
|
| LoadBackup(String) |
Takes settings, alerts, and files from a backup, and applies them to a printer.
|
| LoadBackup(String, Boolean) |
Takes settings, alerts, and files from a backup, and applies them to a printer.
|
| LoadProfile(String) |
Takes settings, alerts, and files from a profile, and applies them to a printer.
|
| LoadProfile(String, FileDeletionOption, Boolean) |
Takes settings, alerts, and files from a profile, and applies them to a printer.
|
TopExample using System;
using System.IO;
using Zebra.Sdk.Comm;
using Zebra.Sdk.Device;
using Zebra.Sdk.Printer;
public class ProfileUtilExample {
private enum ProfileOperations {
CREATE_PROFILE, RESTORE_BACKUP, CLONE_A_PRINTER
};
public static void Main(string[] args) {
string pathToProfile = "C:\\MyNewProfile.zprofile";
ProfileOperations whatToDo = ProfileOperations.CREATE_PROFILE;
TcpConnection connection = new TcpConnection("192.168.1.32", TcpConnection.DEFAULT_ZPL_TCP_PORT);
try {
connection.Open();
ZebraPrinter genericPrinter = ZebraPrinterFactory.GetInstance(connection);
ZebraPrinterLinkOs linkOsPrinter = ZebraPrinterFactory.CreateLinkOsPrinter(genericPrinter);
if (linkOsPrinter != null) {
Console.WriteLine("Start profile operation");
switch (whatToDo) {
case ProfileOperations.CREATE_PROFILE:
linkOsPrinter.CreateProfile(pathToProfile);
break;
case ProfileOperations.RESTORE_BACKUP:
linkOsPrinter.LoadBackup(pathToProfile);
break;
case ProfileOperations.CLONE_A_PRINTER:
linkOsPrinter.LoadProfile(pathToProfile);
break;
}
}
} catch (ConnectionException e) {
Console.WriteLine("Could not use connection");
Console.WriteLine(e.ToString());
} catch (ZebraPrinterLanguageUnknownException e) {
Console.WriteLine("Could not recognize Zebra printer");
Console.WriteLine(e.ToString());
} catch (ZebraIllegalArgumentException e) {
Console.WriteLine("Unexpected response from Zebra printer");
Console.WriteLine(e.ToString());
} catch (IOException e) {
Console.WriteLine("Could not write to " + pathToProfile);
Console.WriteLine(e.ToString());
} finally {
connection.Close();
}
}
}
See Also