Commit Graph
55 Commits
Author SHA1 Message Date
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
Guido Steinhauer 15ea891fad add PT-9700PC support 2026-09-01 10:30:48 +02:00
Dominic Radermacher f7cce68609 fix compile warnings about missing field initializer 2026-07-18 08:07:42 +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
Tobias Klausmann c8ce56e054 libptouch: fix stack buffer overflow in ptouch_sendraster
The raster packet buffer was fixed at 64 bytes, but a full raster line is
max_px/8 bytes plus up to 4 header bytes. For printers with a printhead
wider than 480px this overflows the buffer and smashes the stack. No
previously supported printer was wide enough to trigger it (the widest,
PT-9200DX at 384px, needs 52 bytes), but a 560px printhead needs 74.

Size the buffer to 128 bytes, which is the maximum a single packet can be
since ptouch_send() caps transfers at 128 bytes.
2026-07-18 07:52:44 +02:00
Dominic Radermacher 5cf946bf43 add udev rules for some missing printers 2026-04-20 07:30:44 +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
Dominic Radermacher bdd724fef5 added PT-9200DX with different entry (thanks to Christian Pauls) 2026-02-27 07:50:15 +01:00
Dominic Radermacher fd526f9dbe add param --align for aligning multi-line text centered or right-aligned 2025-12-08 15:33:06 +01:00
Jonas Konrad c2b607be7c Enable pre-cut for PT-H500 2025-12-01 19:38:37 +01:00
Michael Richter 7509ef765c Add support for HSe-251E (heatshrink-tube) tapes 2025-12-01 19:35:59 +01:00
Dominic Radermacher a27a320672 add PT-E560BT (thanks to Paul-Kenji Cahier) 2025-10-31 08:04:08 +01:00
Markus Schramma d8a4ed71e2 add --timeout option 2025-09-28 08:05:41 +02:00
Frost f59e19349b 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.
2025-08-10 08:22:39 +02:00
Dominic Radermacher ab80c721f6 fix compile warning 2025-08-10 07:23:11 +02:00
Dominic Radermacher d1eeacbdd8 Added USB IDs for PT-E550W, but doesn't work yet (only prints empty tape) 2025-08-03 10:11:15 +02:00
Dominic Radermacher 1f450d9124 Add support for PT-E310BT (thanks to Christian Radin) 2025-06-22 08:13:08 +02:00
Dominic Radermacher 2c9828af87 add support for PT-9200DX, thanks Ralf Lieb for reporting 2025-06-01 20:12:20 +02:00
Dominic Radermacher 2f18522602 fix segfault for last commit 2025-05-19 13:33:55 +02:00
Dominic Radermacher ec923ed579 Add support for PT-2300 and fix 112px width centering (thanks to Bradley Erickson) 2025-05-12 17:47:00 +02:00
Nico Sonack aa5392bc13 zero-initialise array to silence valgrind 2024-10-29 20:21:48 +01:00
Dominic Radermacher 740b20e150 Add --copies switch for multiple printouts (thanks to Wojciech Fred) 2024-10-06 17:46:29 +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 ad4e1541de Add cast to silence a compiler warning 2024-02-11 10:33:29 +01:00
Ed Maste dc5b974e74 Add precut flag to P700
With this change my P700 produces about 2cm of waste tape followed by
the desired label, with no additional padding.

As far as I know all of these printers have a cutter, so I am not sure
what determines which modules should have this flag set -- perhaps some
of them can cut at the end of a label only, not at the beginning?

We could perhaps have a commandline option to disable precut.
2024-02-11 10:31:02 +01:00
Martin Dvořák 935dd9a31b added PT-D410 2024-01-05 16:18:31 +01:00
Florian J. Breunig 06a8001bf4 added PT-D610BT
Signed-off-by: Florian J. Breunig <Florian.J.Breunig@my-flow.com>
2024-01-05 07:56:33 +01:00
Dominic Radermacher f22e844eed add (untested) support for PT-D460BT thanks to ccfreak2k 2023-10-13 12:30:33 +02:00
Dominic Radermacher 01d661493f update manpage and project url 2023-03-13 11:17:03 +01:00
Dominic Radermacher 53987c4150 cosmetic changes (some are overdue since many years) 2022-10-05 18:08:06 +02:00
Dominic Radermacher f56d7ea740 fix some compile warnings 2022-09-11 06:45:00 +02:00
Dominic Radermacher 71396e8ff1 change init to first invalidate, then init (maybe needed for some ptouch models?) 2022-09-11 06:29:44 +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 32c29a1c4c fix build using cmake with generating version info from git 2021-10-11 10:11:37 +02:00
Dominic Radermacher 8655736e75 fix naming and try to fix compile errors related to config.h (generated by autotools) 2020-01-13 21:26:48 +01:00
Dominic Radermacher 9509424d56 part 1 of preparing support for high-dpi devices 2019-12-17 21:11:17 +01:00
Dominic Radermacher 815aaf1992 added support for PT-D600, thanks to Johannes Wegener for reporting 2019-11-16 10:26:43 +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 a32e645d79 Added PT-E500, thanks to Jesse Becker for reporting 2019-08-24 06:49:50 +02:00
Dominic Radermacher e806b90e33 add hint for PT-1230PC when in P-Lite mode; quick-n-dirty fix to enable printing for PT-1230PC (but some pixels get cut off) 2019-06-29 11:57:10 +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 fda7848075 fix name of PT-2730, re-order list of devices 2019-05-13 08:27:29 +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 1c552a3d11 change reporting of wrong switch position (not done yet) 2017-07-20 15:03:21 +02:00