Browse Source

Cut paper at the right distance

master
mid-kid 1 year ago
parent
commit
e70e4aac12
  1. 3
      cut_paper.sh
  2. 1
      print_barcode.sh
  3. 9
      print_image.sh

3
cut_paper.sh

@ -2,4 +2,5 @@
set -e
dev=/dev/usb/lp0
printf '\x1DVA\0' > $dev
# Cut paper at about 15mm, the distance between the cutter and the printer
printf '\x1DVA\xc8' > $dev

1
print_barcode.sh

@ -1,3 +1,4 @@
#!/bin/bash
printf '\x1Dk\x05'$1'\0' > /dev/usb/lp0
./cut_paper.sh

9
print_image.sh

@ -20,7 +20,11 @@ printf '\x1B@' > $dev
# Set print speed
printf '\x1D(K\2\0' > $dev
printf '22' > $dev
printf '21' > $dev
# Set head energizing
printf '\x1D(K\2\0' > $dev
printf 'a4' > $dev # 0-4, or \x80 for automatic, default=0
# Upload graphics data
printf '\x1D(L' > $dev
@ -37,5 +41,4 @@ printf '\x1D(L\2\0' > $dev
printf '02' > $dev
# Cut paper
printf '\n\n\n' > $dev
printf '\x1DVA\0' > $dev
./cut_paper.sh

Loading…
Cancel
Save