Mercurial > hg > zebra
comparison README.rst @ 29:63d1260cc64e 0.1.0
- class name is now 'Zebra' instead of 'zebra'
- Fix for missing win32print module in pypi
- Drop python 2 support
- use setuptools instead of distutils
- improve documentation
- Added reset(), reset_default(), autosense(), print_config_label() and
print_graphic() functions
author | Ben Croston <ben@croston.org> |
---|---|
date | Tue, 01 Sep 2020 15:57:24 +0100 |
parents | README@7c132e01c281 |
children |
comparison
equal
deleted
inserted
replaced
28:172de216b85d | 29:63d1260cc64e |
---|---|
1 ============ | |
2 Zebra-0.1.0 | |
3 ============ | |
4 | |
5 Usage: | |
6 | |
7 :: | |
8 | |
9 from zebra import Zebra | |
10 | |
11 z = Zebra( [queue] ) | |
12 Constructor with optional printer queue | |
13 | |
14 z.getqueues() | |
15 Return a list containing available printer queues | |
16 | |
17 z.setqueue( queue ) | |
18 Set the printer queue | |
19 | |
20 z.setup( direct_thermal=None, label_height=None, label_width=None ) | |
21 Set up the label printer using EPL2. Parameters are not set if they are None. | |
22 Not necessary if using AutoSense (hold feed button while powering on) | |
23 direct_thermal - True if using direct thermal labels | |
24 label_height - tuple (label height, label gap) in dots | |
25 label_width - in dots | |
26 | |
27 z.reset_default() | |
28 Resets the printer to factory settings using EPL2 | |
29 | |
30 z.reset() | |
31 Resets the printer using EPL2 - equivalent of switching off/on | |
32 | |
33 z.autosense() | |
34 Run AutoSense by sending an EPL2 command | |
35 Get the printer to detect label and gap length and set the sensor levels | |
36 | |
37 z.print_config_label() | |
38 Send an EPL2 command to print label(s) with current config settings | |
39 | |
40 z.store_graphic( name, filename ) | |
41 Store a 1 bit .PCX file on the label printer using EPL2 | |
42 name - name to be used on printer | |
43 filename - local filename | |
44 | |
45 z.print_graphic( x, y, width, length, data, qty ) | |
46 Print a label from 1 bit data, using EPL2 | |
47 x,y - top left coordinates of the image, in dots | |
48 width - width of image, in dots. Must be a multiple of 8. | |
49 length - length of image, in dots | |
50 data - raw graphical data, in bytes | |
51 qty - number of labels to print | |
52 | |
53 z.output( commands ) | |
54 Output raw commands to the printer | |
55 | |
56 z.print_config_label() | |
57 Print label(s) containing the current printer configuration using EPL2 | |
58 | |
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 |