我不知道我在哪里做错了,但我无法剪纸(部分或全部)。我在我的混合 android 应用程序中使用以下 javascript 代码并在 EPOS 上打印收据。
var _EscCommand = (function () {
function _EscCommand() {
this.ESC = "\u001B";
this.GS = "\u001D";
this.InitializePrinter = this.ESC + "@";
this.BoldOn = this.ESC + "E" + "\u0001";
this.BoldOff = this.ESC + "E" + "\0";
this.DoubleHeight = this.GS + "!" + "\u0001";
this.DoubleWidth = this.GS + "!" + "\u0010";
this.DoubleOn = this.GS + "!" + "\u0011"; // 2x sized text (double-high + double-wide)
this.DoubleOff = this.GS + "!" + "\0";
this.PrintAndFeedMaxLine = this.ESC + "J" + "\u00FF";
this.TextAlignLeft = this.ESC + "a" + "0";
this.TextAlignCenter = this.ESC + "a" + "1";
this.TextAlignRight = this.ESC + "a" + "2";
this.PartialPaperCut = this.GS+"V"+"\0";
this.FullPaperCut = this.GS+"V"+"\1";
}
_EscCommand.prototype.PrintAndFeedLine = function (verticalUnit) {
if (verticalUnit > 255)
verticalUnit = 255;
if (verticalUnit < 0)
verticalUnit = 0;
return this.ESC + "J" + String.fromCharCode(verticalUnit);
};
_EscCommand.prototype.CutAndFeedLine = function (verticalUnit) {
if (verticalUnit === void 0) {
return this.ESC + "V" + 1;
}
if (verticalUnit > 255)
verticalUnit = 255;
if (verticalUnit < 0)
verticalUnit = 0;
return this.ESC + "V" + String.fromCharCode(verticalUnit);
};
return _EscCommand;
} ());
我正在使用 this.PartialPaperCut = this.GS+"V"+"\0"; 线以及我从互联网复制的方法,我没有让裁纸器裁纸。任何帮助都非常感谢..
我在其中构建打印字符串的 Javascript 行: print_dtl += Esc.InitializePrinter+Esc.DoubleOn+" kitchen COPY\n\n" + Esc.DoubleOff +kit_dtl + kit_copy +"\n\n\n\n"+Esc.PrintAndFeedMaxLine + Esc.CutAndFeedLine(); 除了最后剪的纸,我可以打印所有的东西。希望它澄清下面的评论者