Mercurial > hg > zebra
annotate README.rst @ 31:f77ca0963d6d 0.2.0
Fix language bug, convert to pyproject.toml
author | Ben Croston <ben@croston.org> |
---|---|
date | Wed, 12 Feb 2025 15:13:51 +0000 |
parents | 63d1260cc64e |
children |
rev | line source |
---|---|
0 | 1 ============ |
29
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
2 Zebra-0.1.0 |
0 | 3 ============ |
4 | |
5 Usage: | |
6 | |
7 :: | |
8 | |
29
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
9 from zebra import Zebra |
10 | 10 |
29
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
11 z = Zebra( [queue] ) |
17
a9dacd180597
Does not work in python 2.6 after all
Ben Croston <ben@croston.org>
parents:
16
diff
changeset
|
12 Constructor with optional printer queue |
0 | 13 |
14 z.getqueues() | |
17
a9dacd180597
Does not work in python 2.6 after all
Ben Croston <ben@croston.org>
parents:
16
diff
changeset
|
15 Return a list containing available printer queues |
0 | 16 |
16 | 17 z.setqueue( queue ) |
17
a9dacd180597
Does not work in python 2.6 after all
Ben Croston <ben@croston.org>
parents:
16
diff
changeset
|
18 Set the printer queue |
0 | 19 |
16 | 20 z.setup( direct_thermal=None, label_height=None, label_width=None ) |
29
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
21 Set up the label printer using EPL2. Parameters are not set if they are None. |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
22 Not necessary if using AutoSense (hold feed button while powering on) |
16 | 23 direct_thermal - True if using direct thermal labels |
24 label_height - tuple (label height, label gap) in dots | |
25 label_width - in dots | |
0 | 26 |
29
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
27 z.reset_default() |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
28 Resets the printer to factory settings using EPL2 |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
29 |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
30 z.reset() |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
31 Resets the printer using EPL2 - equivalent of switching off/on |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
32 |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
33 z.autosense() |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
34 Run AutoSense by sending an EPL2 command |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
35 Get the printer to detect label and gap length and set the sensor levels |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
36 |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
37 z.print_config_label() |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
38 Send an EPL2 command to print label(s) with current config settings |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
39 |
16 | 40 z.store_graphic( name, filename ) |
29
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
41 Store a 1 bit .PCX file on the label printer using EPL2 |
16 | 42 name - name to be used on printer |
43 filename - local filename | |
44 | |
29
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
45 z.print_graphic( x, y, width, length, data, qty ) |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
46 Print a label from 1 bit data, using EPL2 |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
47 x,y - top left coordinates of the image, in dots |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
48 width - width of image, in dots. Must be a multiple of 8. |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
49 length - length of image, in dots |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
50 data - raw graphical data, in bytes |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
51 qty - number of labels to print |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
52 |
16 | 53 z.output( commands ) |
29
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
54 Output raw commands to the printer |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
55 |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
56 z.print_config_label() |
63d1260cc64e
- class name is now 'Zebra' instead of 'zebra'
Ben Croston <ben@croston.org>
parents:
27
diff
changeset
|
57 Print label(s) containing the current printer configuration using EPL2 |
16 | 58 |
18 | 59 Note: |
60 | |
61 If you are on a Linux or MacOSX machine using CUPS, you may need to set up a | |
62 printer queue using the admin panel at http://localhost:631 |