1
0
mirror of https://git.familie-radermacher.ch/linux/ptouch-print.git synced 2025-08-14 16:03:25 +00:00

Print without the default length margins

Brother's software may default to 0x0e, but that probably assumes you're making text labels and not printing images. For printing images you might want borderless (we certainly do), and for text labels you can always add the margins to the label before printing.

This commit uses 1px length margins instead of 0 to prevent some leftover black on the edges of the next print.
This commit is contained in:
Frost 2025-08-06 22:58:58 -07:00 committed by Dominic Radermacher
parent ab80c721f6
commit f59e19349b

View File

@ -228,10 +228,11 @@ int ptouch_send_d460bt_magic(ptouch_dev ptdev)
uint8_t cmd[7]; uint8_t cmd[7];
/* n1 and n2 are the length margin/spacing, in px? (uint16_t value, little endian) */ /* n1 and n2 are the length margin/spacing, in px? (uint16_t value, little endian) */
/* A value of 0x06 is equivalent to the width margin on 6mm tape */ /* A value of 0x06 is equivalent to the width margin on 6mm tape */
/* A value of 0x01 adds barely any margin, suitable for image printing */
/* The default for P-Touch software is 0x0e */ /* The default for P-Touch software is 0x0e */
/* n3 must be 0x4D or the print gets corrupted! */ /* n3 must be 0x4D or the print gets corrupted! */
/* n4 seems to be ignored or reserved. */ /* n4 seems to be ignored or reserved. */
memcpy(cmd, "\x1b\x69\x64\x0e\x00\x4d\x00", 7); memcpy(cmd, "\x1b\x69\x64\x01\x00\x4d\x00", 7);
return ptouch_send(ptdev, (uint8_t *)cmd, sizeof(cmd)); return ptouch_send(ptdev, (uint8_t *)cmd, sizeof(cmd));
} }