Commit Graph
27 Commits
Author SHA1 Message Date
James A 7fa1e1ac46 add --serial and --list-connected to pick one of several printers
When more than one printer is connected, ptouch-print used the first
one it found. --serial <serial> now uses only the printer with that USB
serial number, and --list-connected lists the connected printers with
their serials.

libptouch gets ptouch_open_serial() and ptouch_list_connected();
ptouch_open() keeps its signature and calls ptouch_open_serial() with
NULL. The serial is checked before the P-Lite and unsupported-raster
checks, so a different printer in the wrong mode no longer ends the
search, and the "found on USB bus" line now shows the serial. The early
error returns in the open loop now free the device list.
2026-09-25 09:51:25 +02:00
Kevin Bradenstein 41c4af0d0d allow a printer to raise the default status timeout
The PT-E560BT stays busy about 2.2 s after even an 8 mm label, so the
1 second default timeout cannot succeed on a job sent straight after
another: printing five chained labels gives a strip carrying three of
them. ptouch-print reports the timeout and exits non-zero correctly every
time, but no amount of waiting helps when the default is below the
printer's fixed overhead.

Add a trailing min_timeout to the device table. Every other row keeps its
initialiser and gets 0, which resolves to the old default of 1; only the
E560BT carries a value. An explicit --timeout always wins.

Raising the global default would also be defensible: ptouch_getstatus()
returns as soon as the status arrives, measured 0.13 s with --timeout 30
against 0.14 s with --timeout 1, so a higher ceiling costs nothing on a
printer that is ready. But that is a judgement about printers I do not
have, so this keeps it to the one that was measured.
2026-09-08 07:19:13 +02:00
Tobias Klausmann 921206cd5f print_img: correct off-center print area via per-device pin_offset
On the PT-P900W the print area is not centered on the 560-pin printhead:
its center sits at pin 272 rather than the head center (pin 280), a fixed
8-pin offset that is constant across all tape widths. Centering the raster
data on the head therefore prints ~0.5mm off-center (measured as a constant
~1mm margin delta across 12/18/36mm tapes, confirmed against the spec).

Add a pin_offset field to _pt_dev_info (0 = centered, the default for all
existing printers) and apply it in print_img. Set it to -8 for the
PT-P900Wc, which reproduces the spec left-margin exactly for every tape
width ((560-print_area)/2 - 8 = documented left margin).

Reference: Brother "Software Developer's Manual - Raster Command Reference,
PT-P900/P900W/P950NW", section 2.3.5 "Raster line" (per-tape left/right
margin and print-area pin counts for the 560-pin head).
https://download.brother.com/welcome/docp100407/cv_ptp900_eng_raster_102.pdf
2026-07-18 08:01:24 +02:00
Tobias Klausmann 9af6276135 add support for PT-P900Wc (04f9:2085, 360dpi, 36mm)
Add the PT-P900Wc with a 560px printhead and 360dpi resolution, using the
P700 init sequence, PackBits raster, the print-information command and
precut support. Verified printing on 36mm laminated tape.

The existing 360dpi handling doubled the 180dpi tape widths, which is wrong
for wide tapes: the 180dpi values are clamped by those printers' 128-pin
printheads, not the true printable area. Add a separate px360 column with
Brother's documented print areas (36mm = 454px, confirmed on hardware; the
narrower widths are from the raster reference and untested) and clamp the
result to max_px so 360dpi printers with a narrower head (PT-9200DX) stay
safe.

Also add the udev uaccess rule for 2085.
2026-07-18 07:56:55 +02:00
Dominic Radermacher 57084a30e6 improve support for 360dpi printers (untested) 2026-03-09 08:01:30 +01:00
Dominic Radermacher 9cd8a5bc22 preparing for support of printers with 360 dpi 2026-03-08 10:26:46 +01:00
Markus Schramma d8a4ed71e2 add --timeout option 2025-09-28 08:05:41 +02:00
Dominic Radermacher 9a0ef8c7d6 Fix chain print support for the D460BT family (thanks to Guilherme Espada) 2024-08-11 13:31:20 +02:00
Kevin Thibedeau da9ed2600a Add chain mode and set precut flag for PT-2700 2024-06-10 16:54:07 +02:00
Ed Maste 8aaeecd84b Add different libusb include path for FreeBSD 2024-02-11 10:34:28 +01:00
Dominic Radermacher f22e844eed add (untested) support for PT-D460BT thanks to ccfreak2k 2023-10-13 12:30:33 +02:00
Dominic Radermacher f56d7ea740 fix some compile warnings 2022-09-11 06:45:00 +02:00
Dominic Radermacher ffc1b1f7b1 media type info now also with text output, thanks to Sönke Peters 2022-09-11 06:25:35 +02:00
Dominic Radermacher 4a79cdf1b1 bugfix for PT D-450 - thanks to Nicklas Björk 2021-08-29 21:32:04 +02:00
Dominic Radermacher adf01d4f63 update author email 2021-01-26 17:05:05 +01:00
Dominic Radermacher 32c0d3be29 add --list-supported command, fix errors in help page 2020-09-26 11:34:02 +02:00
Dominic Radermacher 4a6c15d32e add page flags 2020-07-18 07:21:15 +02:00
Dominic Radermacher 9509424d56 part 1 of preparing support for high-dpi devices 2019-12-17 21:11:17 +01:00
Dominic Radermacher bc192e6e73 prepare support for printers with other resolution than 180dpi 2019-11-03 20:25:04 +01:00
Dominic Radermacher 98541a6f61 add support for PT-P700 (untested) 2019-09-06 21:32:12 +02:00
Dominic Radermacher 4639f7c23d show user hint when PT-2430PC / PT-P700 are in P-Lite mode, show notice about unsupported raster mode 2019-05-23 16:20:40 +02:00
Dominic Radermacher 92dd6aa402 fix several compile warnings 2019-04-08 21:56:55 +02:00
Dominic Radermacher 6b2096cea7 generate the cutmark as image instead of ptouch-commands, so it can be saved as png, too 2019-03-28 16:10:54 +01:00
Dominic Radermacher 213a70eee0 fix support for printers that use packbits transfer mode, like PT-D450PV 2019-03-17 11:36:04 +01:00
Dominic Radermacher 040e271ef0 cosmetic updates ;-) 2017-06-24 10:58:33 +02:00
Dominic Radermacher 4d8bb9179f added more devices, even though printing does NOT work with them 2016-12-10 09:57:33 +01:00
Dominic Radermacher 40c2cdcf3c Initial commit 2015-12-29 14:11:00 +01:00