Coder Social home page Coder Social logo

uniphil / thermalprinter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bobotig/thermalprinter

0.0 3.0 0.0 1.51 MB

Python module to manage the DP-EH600 thermal printer.

Home Page: https://pypi.org/project/thermalprinter/

License: MIT License

Python 100.00%

thermalprinter's Introduction

DP-EH600 thermal printer

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:

python3 -m pip install --upgrade --user 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)

    # Greek (excepted the ΐ character)
    printer.out('Στην υγειά μας!', codepage=CodePage.CP737)

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

    # Line feeds
    printer.feed(2)

thermalprinter's People

Contributors

bobotig avatar akokkalas avatar phillipthelen avatar d21d3q avatar

Watchers

phil avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.