app/models/extface/driver/base/print.rb in extface-0.5.5 vs app/models/extface/driver/base/print.rb in extface-0.5.6
- old
+ new
@@ -11,10 +11,17 @@
RAW = true #responds to #push(data) and #pull
PRINT = true #POS, slip printers
FISCAL = false #cash registers, fiscal printers
REPORT = false #only transmit data that must be parsed by handler, CDR, report devices
- alias_method :print, :push
+ #alias_method :print, :push
+ def print(text)
+ if device.encoding.present?
+ push text.encode(device.encoding)
+ else
+ push text
+ end
+ end
def print_test_page(times = 1)
device.session("Print Test Page") do |s|
times.times do |t|
s.notify "Printing Test Page #{t}"
\ No newline at end of file