Compare commits
No commits in common. "6c1a94d98f4536a3819c729219abd94473ca1ac6" and "8480dd070c903d4e49894fcda4040927839f8708" have entirely different histories.
6c1a94d98f
...
8480dd070c
35
printlib.php
35
printlib.php
@ -90,39 +90,4 @@ function printean8($data) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function rawdlen($data) {
|
||||
$len = strlen($data);
|
||||
$l = ($len + 3) % 256;
|
||||
$h = intdiv($len, 256);
|
||||
if ($l<16) {
|
||||
$l=hex2bin("0" . dechex($l));
|
||||
} else {
|
||||
$l=hex2bin(dechex($l));
|
||||
}
|
||||
if ($h<16) {
|
||||
$h=hex2bin("0" . dechex($h));
|
||||
} else {
|
||||
$h=hex2bin(dechex($h));
|
||||
}
|
||||
return $l . $h;
|
||||
}
|
||||
function printqr($data, $size = 8) {
|
||||
if (strlen($data)<7088) {
|
||||
if ($size<16) {
|
||||
$encs=hex2bin("0" . dechex($size));
|
||||
} else {
|
||||
$encs=hex2bin(dechex($size));
|
||||
}
|
||||
$lp=fopen("/dev/usb/lp0", 'w');
|
||||
fwrite($lp, GS . "(k\x04\x00\x31\x41\x32\x00");
|
||||
fwrite($lp, GS . "(k\x03\x00\x31\x43" . $encs);
|
||||
fwrite($lp, GS . "(k\x03\x00\x31\x45\x30");
|
||||
fwrite($lp, GS . "(k" . rawdlen($data) . "\x31\x50\x30" . $data);
|
||||
fwrite($lp, GS . "(k\x03\x00\x31\x51\x30");
|
||||
#fwrite($lp, "\x0a");
|
||||
fclose($lp);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user