@@ -8,22 +8,38 @@ Labelprinterkit's simple layout engine can be used to declaratively create
88simple labels:
99
1010``` python
11- >> > class MyLabel (Label ):
12- ... items = [
13- ... Text(), Text()
14- ... ]
15- ...
16- >> > l = MyLabel(" text1" , " text2" )
17- >> > printer.print_label(l)
11+ from Labelprinterkit import backends, items, label
12+ from Labelprinterkit.printers.brother_pt700 import P700
13+
14+ # Define the layout of our label
15+ # We define a single row with two text items.
16+ # In real usage, you will probably want to change the font of the text.
17+ class MyLabel (label .Label ):
18+ items = [
19+ items.Text(pad_right = 50 ), items.Text()
20+ ]
21+
22+ # Instantiate the label with specific data
23+ l = MyLabel(" text1" , " text2" )
24+ # scan for a USB printer using the PyUSBBackend
25+ printer = P700(PyUSBBackend.auto()
26+ # Print!
27+ printer.print_label(l)
1828```
1929
2030The Following printers are currently supported:
2131
2232 * Brother P- Touch PT - 700 (aka P700)
2333
24- The following printers will probably work, but are not tested:
34+ The following printers will probably work, as they are supposedly identical,
35+ but have not been tested (please tell us if they do!):
2536
2637 * Brother H500
2738 * Brother E500
2839
40+ The following backends are currently supported:
41+
42+ * USB Printer Device Class via PyUSB
43+
2944The official source of this repository is at https:// git.scc.kit.edu/ scc- net/ labelprinterkit.
45+ Pull requests and issues are also accepted on github at https:// github.com/ notafile/ labelprinterkit.
0 commit comments