有人知道如何在印刷原始原始esc / post中修复它吗?我尝试了一些示例代码,但没有任何效果。 我在这里查看参考Web Manuallib 这是我使用的脚本:
function print(o) {
if (jspmWSStatus()) {
var cpj = new JSPM.ClientPrintJob();
if ($('#useDefaultPrinter').prop('checked')) {
cpj.clientPrinter = new JSPM.DefaultPrinter();
} else {
cpj.clientPrinter = new JSPM.InstalledPrinter($('#installedPrinterName').val());
}
var esc = '\x1B';
var newLine = '\x0A';
<?php
include "../conn.php";
$id = $_GET['id'];
$qry = mysqli_query($koneksi, "SELECT * FROM table WHERE id='$id'");
$data = mysqli_fetch_array($qry);
$agent_code = $data["agent_code"];
$agent_name = $data["agent_name"];
$achievement = $data["achievement"];
?>
var cmds = esc + "@";
cmds += esc + '!' + '\x38';
cmds += 'COMPANY\n';
cmds += newLine + newLine;
// cmds += "\x1d\x6b\x04<?=$id?>\x00"; //BARCODE (SUCCESS)
// cmds += esc + 'iQ\x04\x02\x00\x00\x00\x00\x02\x00123456789\\\ '; //QR CODE
cmds += esc + 'i Q \x04 \x02 \x01 \x01 \x03 \x31 \x02 \x00 123 \\\ ';
cmds += esc + 'i Q \x04 \x02 \x01 \x02 \x03 \x31 \x02 \x00 456 \\\ ';
cmds += esc + 'i Q \x04 \x02 \x01 \x03 \x03 \x31 \x02 \x00 789 \\\ ';
cmds += esc + '!' + '\x00';
cmds += 'ID : ' + '<?=$id?>';
cmds += newLine;
cmds += 'AGENT CODE : ' + '<?=$agent_code?>';
cmds += newLine;
cmds += 'NAME : ' + '<?=$agent_name?>';
cmds += newLine;
cmds += 'ACHIEVEMENT : ' + '<?=$achievement?>\n';
cmds += esc + '!' + '\x00'; //Character font A selected (ESC ! 0)
cmds += newLine + newLine;
cpj.printerCommands = cmds;
cpj.sendToClient();
}
}
感谢进阶!