diff --git a/cut_paper.sh b/cut_paper.sh index 97940bc..fd3d73a 100755 --- a/cut_paper.sh +++ b/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 diff --git a/print_barcode.sh b/print_barcode.sh index 6fc515e..5ccbe3c 100755 --- a/print_barcode.sh +++ b/print_barcode.sh @@ -1,3 +1,4 @@ #!/bin/bash printf '\x1Dk\x05'$1'\0' > /dev/usb/lp0 +./cut_paper.sh diff --git a/print_image.sh b/print_image.sh index c58c337..b9f8d3a 100755 --- a/print_image.sh +++ b/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