Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Another example based on the Network printer class:

from escpos.printer import Network

kitchen = Network("192.168.1.100") #Printer IP Address
kitchen = Network("192.168.1.100", profile="TM-T88III") #Printer IP Address
kitchen.text("Hello World\n")
kitchen.barcode('4006381333931', 'EAN13', 64, 2, '', '')
kitchen.cut()
Expand All @@ -71,18 +71,22 @@ Another example based on the Serial printer class:
from escpos.printer import Serial

""" 9600 Baud, 8N1, Flow Control Enabled """
p = Serial(devfile='/dev/tty.usbserial',
baudrate=9600,
bytesize=8,
parity='N',
stopbits=1,
timeout=1.00,
dsrdtr=True)
p = Serial(
devfile='/dev/tty.usbserial',
baudrate=9600,
bytesize=8,
parity='N',
stopbits=1,
timeout=1.00,
dsrdtr=True,
profile="TM-T88III"
)

p.text("Hello World\n")
p.qr("You can readme from your smartphone")
p.cut()

.. note:: It is highly recommended to include a matching profile to inform python-escpos about the printer's capabilities.

The full project-documentation is available on
`Read the Docs <https://python-escpos.readthedocs.io>`_.
Expand Down
8 changes: 8 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@
# documentation.
# html_theme_options = {}

# Show a 'Edit on GitHub' link instead of 'View page source'
html_context = {
"display_github": True,
"github_user": "python-escpos",
"github_repo": "python-escpos",
"github_version": "master/doc/",
}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []

Expand Down
11 changes: 7 additions & 4 deletions doc/user/usage.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Usage
=====

:Last Reviewed: 2023-08-10
:Last Reviewed: 2025-02-16

Define your printer
-------------------
Expand Down Expand Up @@ -113,7 +113,7 @@ on a USB interface.

from escpos import *
""" Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88IV) """
p = printer.Usb(0x04b8,0x0202)
p = printer.Usb(0x04b8,0x0202, profile="TM-T88IV")
# Print text
p.text("Hello World\n")
# Print image
Expand Down Expand Up @@ -180,13 +180,15 @@ An example file printer::
printer:
type: File
devfile: /dev/someprinter
profile: TM-U220

And for a network printer::

printer:
type: Network
host: 127.0.0.1
port: 9000
profile: TM-U220

An USB-printer could be defined by::

Expand All @@ -196,6 +198,7 @@ An USB-printer could be defined by::
idProduct: 0x5678
in_ep: 0x66
out_ep: 0x01
profile: TM-U220

Printing text right
-------------------
Expand Down Expand Up @@ -250,8 +253,8 @@ Here you can download an example, that will print a set of common barcodes:

.. _advanced-usage-change-capabilities-profile:

Advanced Usage: change capabilities-profile
-------------------------------------------
Advanced Usage: change where is the capabilities-profile
--------------------------------------------------------

Packaged together with the escpos-code is a capabilities-file. This file in
JSON-format describes the capabilities of different printers. It is developed and hosted in
Expand Down