Giter VIP home page Giter VIP logo

pos-printer's Introduction

Gem Version Build Status

pos-printer

Ruby library for printing using ESC/POS (thermal) printers using CUPS.

Install

Add the following line to Gemfile:

gem 'pos-printer'

and run bundle install from your shell.

To install the gem manually from your shell, run:

gem install pos-printer

Usage

require 'pos-printer'

POS::Printer.print('my-printer-name-on-cups') do |p|
  p.align_center
  p.print_logo
  p.big_font
  p.text 'MY HEADER'
  p.align_left
  p.small_font
  p.text 'some body'
end

You may also specify extra options to pass to lp:

require 'pos-printer'

POS::Printer.print('my-printer-name-on-cups', lp_options: ['-h', 'somehost:port']) do |p|
  # Your printing code
end

More Information

pos-printer's People

Contributors

yusent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pos-printer's Issues

Some spanish characters require multilingual character table

.gsub("Á".b, "\xB5".b)

.gsub("Í".b, "\xD6".b)
.gsub("Ó".b, "\xE0".b)
.gsub("Ú".b, "\xE9".b)

These four character substitutions will work only when the character code table set for the printer is Multilingual ("\et\x02"). When the character code table is the default one (USA, Standard Europe, "\et\x00") different characters are shown.

Examples of this can be seen in the reference manual

No matter what i do, print_logo doesn't work

Every time I try to add a picture/logo, nothing happens.
The print_logo function doesn't work for me, maybe I'm doing it wrong, but when I add just 'print_logo' nothing happens, so I add something for it to print, a link or a file path or something like that, I get an error saying 'The wrong number of arguments given, expected 0 got 1'
So I'm not supposed to give it anything to print (how is it supposed to know what I want to print???) and if I do, I get an error, has anybody else gotten this? What do I do to get an image to work?

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.