Skip to main content

Driver for the DP-EH600 thermal printer (AdaFruit).

Project description

https://travis-ci.org/BoboTiG/thermalprinter.svg?branch=master

Python module to manage the DP-EH600 thermal printer (the one sold by AdaFruit).

Installation

As simple as:

pip install thermalprinter

Usage

An example is better than thousand words:

from PIL import Image
from ThermalPrinter import *

with ThermalPrinter(port='/dev/ttyAMA0') as printer:
    # Picture
    printer.image(Image.open('gnu.png'))

    # Bar codes
    printer.barcode_height(80)
    printer.barcode_position(BarCodePosition.BELOW)
    printer.barcode_width(3)
    printer.barcode('012345678901', BarCode.EAN13)

    # Styles
    printer.out('Bold', bold=True)
    printer.out('Double height', double_height=True)
    printer.out('Double width', double_width=True)
    printer.out('Inverse', inverse=True)
    printer.out('Rotate 90°', rotate=True, codepage=CodePage.ISO_8859_1)
    printer.out('Strike', strike=True)
    printer.out('Underline', underline=1)
    printer.out('Upside down', upside_down=True)

    # Chinese (almost all alphabets exist)
    printer.out('现代汉语通用字表', chinese=True,
                chinese_format=Chinese.UTF_8)

    # Accents
    printer.out('Voilà !', justify='C', strike=True,
                underline=2, codepage=CodePage.ISO_8859_1)

    # Line feeds
    printer.feed(2)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thermalprinter-0.1.7.tar.gz (11.0 kB view details)

Uploaded Source

File details

Details for the file thermalprinter-0.1.7.tar.gz.

File metadata

File hashes

Hashes for thermalprinter-0.1.7.tar.gz
Algorithm Hash digest
SHA256 655c8e742bc09374aedea71e00f98df1c944508c0c6866630197edefdae2441f
MD5 b66487e50fa151305f4e215bb4d87492
BLAKE2b-256 2d60d3d1beeaabb8da34028460d2e6bfb906e071965257e2b5e72f8c09667193

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page