从Javascript(Android混合应用程序)切割TM T70II Epson热敏打印机(ePOS)

时间:2017-09-21 00:08:30

标签: javascript android printing epos

我不知道我在哪里做错了但是我不能得到剪纸(部分或全部)。我在我的混合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;

}());

我正在使用此.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(); 我可以打印除了最后剪纸以外的所有内容。希望它澄清下面的评论员

0 个答案:

没有答案