Code Monkey home page Code Monkey logo

etiquette's Introduction

Etiquette

Print labels on a Brother P-touch P700 printer from the command line, without any special drivers.

echo "Label" | etiquette /dev/usb/lpN

Features

  • Print a list of newline delimited labels from stdin as one job, only wasting the ~25mm of feed tape once per job:

    echo -e "Label 1\nLabel 2" | etiquette /dev/usb/lpN
    

    (Make sure to remove labels as they feed out, otherwise small ones can pile up and slow down the printer, offsetting the text on the next labels.)

  • Detect tape size loaded into printer, and automatically pick corresponding font size.

  • Print pre-rendered images, for example QR codes:

    qrencode --symversion=3 --strict-version --size 4 --margin 1 -o- "http://go.afab.re/etiquette" | etiquette -img /dev/usb/lpN
    
  • Preview the output as a PNG:

    echo "Label" | ./etiquette -preview label.png /dev/usb/lpN
    

Requirements

  • Linux usblp driver.
  • Printer should show up as /dev/usb/lpN.
  • Permission to access /dev/usb/lpN. Typically add yourself to the lp group:
    • sudo usermod -aG lp $USER; newgrp lp

Install

With a working Go installation:

go install go.afab.re/etiquette/cmd/etiquette@latest

Alternatives

  • ptouch-print

    • Doesn't support printing and cutting multiple labels at a time.
    • Font size varies based on text: labels with descenders (eg g) will use a smaller font than those without.
  • B-Label

    • Doesn't support printing multiple labels at a time.
    • Doesn't output anything with the P700 printer.
  • ptouch-driver

    • CUPS driver.

    • Need to manually specify label length, defaults to 100mm. Eg:

      lp -d PT-P700 -o PageSize=Custom.17x70 -o landscape
      
    • Supports printing and cutting multiple labels at a time.

etiquette's People

Contributors

arthurfabre avatar

Stargazers

 avatar

Watchers

 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.