0.0
No commit activity in last 3 years
No release in over 3 years
Library for printing using ESC/POS (thermal) printers using CUPS.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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