2015-12-27 15:56:51 +00:00
|
|
|
Printers
|
2023-08-08 22:52:01 +00:00
|
|
|
========
|
|
|
|
|
2023-08-16 23:37:50 +00:00
|
|
|
:Last Reviewed: 2023-08-23
|
2017-01-25 23:23:50 +00:00
|
|
|
|
2023-08-09 23:38:47 +00:00
|
|
|
As of now there are 8 different types of printer implementations.
|
2017-01-25 23:23:50 +00:00
|
|
|
|
|
|
|
USB
|
|
|
|
---
|
|
|
|
The USB-class uses pyusb and libusb to communicate with USB-based
|
2023-08-09 23:38:47 +00:00
|
|
|
printers.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
This driver is not suited for USB-to-Serial-adapters
|
2023-09-07 20:08:31 +00:00
|
|
|
and similar devices, but only for those implementing native USB.
|
2017-01-25 23:23:50 +00:00
|
|
|
|
|
|
|
.. autoclass:: escpos.printer.Usb
|
|
|
|
:members:
|
|
|
|
:special-members:
|
|
|
|
:member-order: bysource
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Serial
|
|
|
|
------
|
|
|
|
This driver uses pyserial in order to communicate with serial devices.
|
|
|
|
If you are using an USB-based adapter to connect to the serial port,
|
|
|
|
then you should also use this driver.
|
|
|
|
The configuration is often based on DIP-switches that you can set on your
|
|
|
|
printer. For the hardware-configuration please refer to your printer's manual.
|
|
|
|
|
|
|
|
.. autoclass:: escpos.printer.Serial
|
|
|
|
:members:
|
|
|
|
:special-members:
|
|
|
|
:member-order: bysource
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Network
|
|
|
|
-------
|
|
|
|
|
|
|
|
This driver is based on the socket class.
|
|
|
|
|
|
|
|
.. autoclass:: escpos.printer.Network
|
|
|
|
:members:
|
|
|
|
:special-members:
|
|
|
|
:member-order: bysource
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Troubleshooting
|
|
|
|
^^^^^^^^^^^^^^^
|
2023-08-09 23:38:47 +00:00
|
|
|
Problems with a network-attached printer can have numerous causes.
|
|
|
|
Make sure that your device has a proper IP address.
|
|
|
|
Often you can check the IP address by triggering the self-test of the device.
|
|
|
|
As a next step try to send text manually to the device.
|
|
|
|
You could use for example:
|
2016-07-15 11:15:22 +00:00
|
|
|
|
2017-01-25 23:23:50 +00:00
|
|
|
::
|
2016-08-02 02:38:04 +00:00
|
|
|
|
2017-01-25 23:23:50 +00:00
|
|
|
echo "OK\n" | nc IPADDRESS 9100
|
|
|
|
# the port number is often 9100
|
2016-07-15 11:15:22 +00:00
|
|
|
|
2023-08-09 23:38:47 +00:00
|
|
|
As a last resort try to reset the interface of the printer.
|
|
|
|
This should be described in its manual.
|
2016-07-15 11:15:22 +00:00
|
|
|
|
2017-01-25 23:23:50 +00:00
|
|
|
File
|
|
|
|
----
|
2023-08-09 23:38:47 +00:00
|
|
|
This printer "prints" just into a file-handle.
|
|
|
|
Especially on \*nix-systems this comes very handy.
|
2017-01-25 23:23:50 +00:00
|
|
|
|
|
|
|
.. autoclass:: escpos.printer.File
|
|
|
|
:members:
|
|
|
|
:special-members:
|
|
|
|
:member-order: bysource
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Dummy
|
|
|
|
-----
|
2023-08-09 23:38:47 +00:00
|
|
|
The Dummy-printer is mainly for testing- and debugging-purposes.
|
|
|
|
It stores all of the "output" as raw ESC/POS in a string and returns that.
|
2015-12-27 15:56:51 +00:00
|
|
|
|
2017-01-25 23:23:50 +00:00
|
|
|
.. autoclass:: escpos.printer.Dummy
|
|
|
|
:members:
|
|
|
|
:member-order: bysource
|
|
|
|
:noindex:
|
2016-08-02 02:38:04 +00:00
|
|
|
|
2022-12-11 15:29:33 +00:00
|
|
|
CUPS
|
|
|
|
----
|
|
|
|
This driver uses `pycups` in order to communicate with a CUPS server.
|
|
|
|
Supports both local and remote CUPS printers and servers.
|
|
|
|
The printer must be properly configured in CUPS administration.
|
|
|
|
The connector generates a print job that is added to the CUPS queue.
|
|
|
|
|
2023-08-09 23:38:47 +00:00
|
|
|
.. autoclass:: escpos.printer.CupsPrinter
|
|
|
|
:members:
|
|
|
|
:member-order: bysource
|
|
|
|
:noindex:
|
2022-12-11 15:29:33 +00:00
|
|
|
|
|
|
|
LP
|
|
|
|
----
|
|
|
|
This driver uses the UNIX command `lp` in order to communicate with a CUPS server.
|
|
|
|
Supports local and remote CUPS printers.
|
|
|
|
The printer must be properly configured in CUPS administration.
|
|
|
|
The connector spawns a new sub-process where the command lp is executed.
|
|
|
|
|
2023-08-09 23:38:47 +00:00
|
|
|
No dependencies required, but somehow the print queue will affect some
|
|
|
|
print job such as barcode.
|
2022-12-11 15:29:33 +00:00
|
|
|
|
|
|
|
.. autoclass:: escpos.printer.LP
|
|
|
|
:members:
|
|
|
|
:special-members:
|
|
|
|
:member-order: bysource
|
|
|
|
:noindex:
|
2023-08-09 23:38:47 +00:00
|
|
|
|
|
|
|
Win32Raw
|
|
|
|
--------
|
|
|
|
This driver uses a native WIN32 interface of Windows in order to print.
|
|
|
|
Please refer to the code for documentation as this driver is currently
|
|
|
|
not included in the documentation build.
|
|
|
|
|
2023-08-16 23:37:50 +00:00
|
|
|
.. autoclass:: escpos.printer.Win32Raw
|
|
|
|
:members:
|
|
|
|
:special-members:
|
|
|
|
:member-order: bysource
|
|
|
|
:noindex:
|