Compare commits

..

3 Commits

Author SHA1 Message Date
9db00dd64c Fix die-cut label printing
All checks were successful
Alpine 3.21 Success
2025-05-01 15:57:59 +02:00
3832ca749f README.adoc: circumvent an issue with libasciidoc
All checks were successful
Alpine 3.19 Success
2022-05-01 18:18:31 +02:00
f37c194ab8 Bump Go modules to 1.17 2021-08-19 05:35:58 +02:00
3 changed files with 14 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ Runtime dependencies: Linux, a Brother QL label printer connected over USB
$ go get -u https://janouch.name/sklad/cmd/sklad
You will need to bootstrap the database by writing a minimal 'db.json':
....
{
"Password": "login-password",

2
go.mod
View File

@@ -1,5 +1,5 @@
module janouch.name/sklad
go 1.12
go 1.17
require github.com/boombuler/barcode v1.0.1

View File

@@ -240,8 +240,17 @@ func makePrintData(status *Status, image image.Image, rb bool) (data []byte) {
mediaType = byte(0x0b)
}
data = append(data, 0x1b, 0x69, 0x7a, 0x02|0x04|0x40|0x80, mediaType,
byte(status.MediaWidthMM()), byte(status.MediaLengthMM()),
const (
flagValidMediaType = 0x02
flagValidMediaWidth = 0x04
flagValidMediaLength = 0x08
flagPriorityToQuality = 0x40
flagRecoveryAlwaysOn = 0x80
)
data = append(data, 0x1b, 0x69, 0x7a, flagValidMediaType|
flagValidMediaWidth|flagValidMediaLength|
flagPriorityToQuality|flagRecoveryAlwaysOn,
mediaType, byte(status.MediaWidthMM()), byte(status.MediaLengthMM()),
byte(dy), byte(dy>>8), byte(dy>>16), byte(dy>>24), 0, 0x00)
// Auto cut, each 1 label.
@@ -256,7 +265,7 @@ func makePrintData(status *Status, image image.Image, rb bool) (data []byte) {
data = append(data, 0x1b, 0x69, 0x4b, 0x08)
}
if status.MediaLengthMM() != 0 {
if status.MediaLengthMM() == 0 {
// 3mm margins along the direction of feed. 0x23 = 35 dots, the minimum.
data = append(data, 0x1b, 0x69, 0x64, 0x23, 0x00)
} else {