pos-printer

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


Keywords
escpos, escpos-printer, printing, ruby, ruby-gem, ruby-library, rubygem, rubygems
License
MIT
Install
gem install pos-printer -v 0.0.10

Documentation

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