using System;
using System.Collections.Generic;
using System.Text;
namespace MacPrinter
{
public class ZPL_Command
{
/// (^EF)<summary>
/// 清除设定 (已包含起始结束命令)
/// </summary>
/// <returns></returns>
public string _CmdEraseSetup()
{
string st = "^XA^EF^FS^XZ";
return st.ToUpper();
}
/// <summary>
///(^XA) ZPL命令开始
/// </summary>
/// <returns></returns>
public string _CmdStart()
{
return "^XA".ToUpper();
}
/// <summary>
///(^XZ) ZPL命令结尾
/// </summary>
/// <returns></returns>
public string _CmdEnd()
{
return "^XZ".ToUpper();
}
/// <summary>
/// (^FS)一个字段的结束(结束一行命令)
/// </summary>
/// <returns></returns>
public string _CmdLineEnd()
{
return "^FS".ToUpper();
}
/// <summary>
///(^A)字体设定{^Af,o,h,w}
/// </summary>
/// <param name="DesiredFont">(f)需要选择的字体默认为O(A-Z,1-9)</param>
/// <param name="FontOrientation">(o)字体是否旋转默认N(R旋转90°,I旋转180°,B旋转270°,)</param>
/// <param name="FontHeight">(h)设定字体高度以点计算默认为15(10-1500)</param>
/// <param name="FontWidth">(w)设定字体宽度以点计算默认为12(10-1500)</param>
/// <returns></returns>
public string _SetFont(string DesiredFont, string FontOrientation, int FontHeight, int FontWidth)
{
string _a = string.Format("^A{0}{1},{2},{3}", DesiredFont, FontOrientation, FontHeight, FontWidth);
return _a.ToUpper();
}
/// <summary>
/// (^A)字体设定{^Af,o,h,w}
/// </summary>
/// <param name="DesiredFont">(f)需要选择的字体默认为O(A-Z,1-9)</param>
/// <param name="FontHeight">(h)设定字体高度以点计算默认为15(10-1500)</param>
/// <param name="FontWidth">(w)设定字体宽度以点计算默认为12(10-1500)</param>
/// <returns></returns>
public string _SetFont(string DesiredFont, int FontHeight, int FontWidth)
{
return this._SetFont(DesiredFont, "N", FontHeight, FontWidth);
}
/// <summary>
/// (^A@)调用字体名字设定字体{^A@o,h,w,n}
/// </summary>
/// <param name="FontOrientation">字体是否旋转默认N(R旋转90°,I旋转180°,B旋转270°,)</param>
/// <param name="FontHeight">设定字体高度以点计算默认为15(10-1500)</param>
/// <param name="FontWidth">设定字体宽度以点计算默认为12(10-1500)</param>
/// <param name="FontName">Font Name(Cyrillic.FNT)</param>
/// <returns></returns>
public string _SetFont(string FontOrientation, int FontHeight, int FontWidth, string FontName)
{
return string.Format("^A@{0},{1},{2},{3}", FontOrientation, FontHeight, FontWidth, FontName);
}
/// <summary>
/// (^B1o,e,h,f,g)
/// </summary>
/// <returns></returns>
public string _SetCode11()
{
return "";
}
/// <summary>
/// (^B3)Code39码(^B3o,e,h,f,g)
/// </summary>
/// <param name="Orientation">Orientation:
///Default value: Current ^FW setting
///Other values:
///N = Normal;
///R = Rotated, 90 degrees clockwise;
///I = Inverted, 180 degrees;
///B = Read from Bottom Up, 270 degrees;</param>
/// <param name="e">Mod-43 Check Digit:
///Default value: N = No;
///Other value: Y = Yes</param>
/// <param name="Height">Bar Code Height:
/// Default value: Value set by ^BY ;
///Other values: 1 dot to 9999 dots
/// </param>
/// <param name="f">Print Interpretation Line
///Default value: Y = Yes;
///Other value: N = No</param>
/// <param name="g">Print Interpretation Line Above Code
///Default value: N = No ;
///Other value: Y = Yes</param>
/// <returns></returns>
public string _SetCode39(string Orientation, string e, int Height, string f, string g)
{
return string.Format("^B3{0},{1},{2},{3},{4}", Orientation, e, Height, f, g).ToUpper();
}
/// <summary>
/// (^B4)Code49码(^B4o,h,f,m)
/// </summary>
/// <param name="Orientation">
/// Orientation
///Default value: Current ^FW value
///(^FW defaults to N = Normal at power-up);
///Other values:
///N = Normal;
///R = Rotated, 90 degrees clockwise;
///I = Inverted, 180 degrees;
///B = Read from Bottom Up, 270 degrees;</param>
/// <param name="Height">Height Multiplier of Individual Rows
///Defined: This number, multiplied by the module,;
///equals the height of the individual rows in dots.;
///Default value: Value set by ^BY;
///Other values: 1 to height of label.;
///NOTE: 1 is not a recommended value.</param>
/// <param name="f">Print Interpretation Line
///Default value: N = No line printed.
///Other values:
///A = Print interpretation line above code.;
///B = Print interpretation line below code.</param>
/// <param name="m">Starting Mode
///Default value: A = Automatic Mode. Printer determines
///starting mode by analyzing field data.;
///Other values:
///0 = Regular Alphanumeric Mode;
///1 = Multiple Read Alphanumeric;
///2 = Regular Numeric Mode;
///3 = Group Alphanumeric Mode;
///4 = Regular Alphanumeric Shift 1;
///5 = Regular Alphanumeric Shift 2;</param>
/// <returns></returns>
public string _SetCode49(string Orientation, int Height, string f, string m)
{
return string.Format("^B4{0},{1},{2},{3}", Orientation, Height, f, m).ToUpper();
}
/// <summary>
/// (^B7)PDF417 Bar Code(^B7o,h,s,c,r,t)
/// </summary>
/// <param name="o">Orientation Default value: Current ^FW value
///
///(^FW defaults to N = Normal at power-up);
///Other values:
///N = Normal;
///R = Rotated, 90 degrees clockwise;
///I = Inverted, 180 degrees;
///B = Read from Bottom Up, 270 degrees;</param>
/// <param name="h">Bar Code Height for Individual Rows
///(This number, multiplied by the module, equals the
///height of the individual rows in dots.)
///Default value: Value set by ^BY;
///Other values: 1 dot t
C#打印机操作类
最新推荐文章于 2025-01-18 22:04:32 发布
