c#餐饮系统打印机_C#打印机操作类

这是一个C#类库,用于生成ZPL指令来操作餐饮系统的标签打印机。类库包含了设置字体、开始和结束ZPL命令、设置条形码(如Code 128, Code 39等)、设置字段位置、设置打印速度和宽度等功能。" 131340050,783471,华为OD统一考试B卷:找两数组共现整数,"['算法', '编程', '华为OD', '考试']
摘要由CSDN通过智能技术生成

using System;

using System.Collections.Generic;

using System.Text;

namespace MacPrinter

{

public class ZPL_Command

{

/// (^EF)

/// 清除设定 (已包含起始结束命令)

///

///

public string _CmdEraseSetup()

{

string st = "^XA^EF^FS^XZ";

return st.ToUpper();

}

///

///(^XA) ZPL命令开始

///

///

public string _CmdStart()

{

return "^XA".ToUpper();

}

///

///(^XZ) ZPL命令结尾

///

///

public string _CmdEnd()

{

return "^XZ".ToUpper();

}

///

/// (^FS)一个字段的结束(结束一行命令)

///

///

public string _CmdLineEnd()

{

return "^FS".ToUpper();

}

///

///(^A)字体设定{^Af,o,h,w}

///

/// (f)需要选择的字体默认为O(A-Z,1-9)

/// (o)字体是否旋转默认N(R旋转90°,I旋转180°,B旋转270°,)

/// (h)设定字体高度以点计算默认为15(10-1500)

/// (w)设定字体宽度以点计算默认为12(10-1500)

///

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();

}

///

/// (^A)字体设定{^Af,o,h,w}

///

/// (f)需要选择的字体默认为O(A-Z,1-9)

/// (h)设定字体高度以点计算默认为15(10-1500)

/// (w)设定字体宽度以点计算默认为12(10-1500)

///

public string _SetFont(string DesiredFont, int FontHeight, int FontWidth)

{

return this._SetFont(DesiredFont, "N", FontHeight, FontWidth);

}

///

/// (^A@)调用字体名字设定字体{^A@o,h,w,n}

///

/// 字体是否旋转默认N(R旋转90°,I旋转180°,B旋转270°,)

/// 设定字体高度以点计算默认为15(10-1500)

/// 设定字体宽度以点计算默认为12(10-1500)

/// Font Name(Cyrillic.FNT)

///

public string _SetFont(string FontOrientation, int FontHeight, int FontWidth, string FontName)

{

return string.Format("^A@{0},{1},{2},{3}", FontOrientation, FontHeight, FontWidth, FontName);

}

///

/// (^B1o,e,h,f,g)

///

///

public string _SetCode11()

{

return "";

}

///

/// (^B3)Code39码(^B3o,e,h,f,g)

///

/// 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;

/// Mod-43 Check Digit:

///Default value: N = No;

///Other value: Y = Yes

/// Bar Code Height:

/// Default value: Value set by ^BY ;

///Other values: 1 dot to 9999 dots

///

/// Print Interpretation Line

///Default value: Y = Yes;

///Other value: N = No

/// Print Interpretation Line Above Code

///Default value: N = No ;

///Other value: Y = Yes

///

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();

}

///

/// (^B4)Code49码(^B4o,h,f,m)

///

///

/// 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;

/// 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.

/// Print Interpretation Line

///Default value: N = No line printed.

///Other values:

///A = Print interpretation line above code.;

///B = Print interpretation line below code.

/// 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;

///

public string _SetCode49(string Orientation, int Height, string f, string m)

{

return string.Format("^B4{0},{1},{2},{3}", Orientation, Height, f, m).ToUpper();

}

///

/// (^B7)PDF417 Bar Code(^B7o,h,s,c,r,t)

///

/// 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;

/// 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值