class Languages::Zpl2::Barcode2D

Constants

BarcodeClasses

Public Class Methods

new(code_type, opts = {}) click to toggle source
# File lib/languages/zpl2/barcode.rb, line 38
def initialize(code_type, opts = {})
  @font = opts[:font] || Font.new
  @code, @symbol_height, @columns_encode, @rows_encode = BarcodeClasses[code_type]
  @text = opts[:text] || ""
end

Public Instance Methods

render() click to toggle source
# File lib/languages/zpl2/barcode.rb, line 44
def render
  "^B#{@code}#{@font.rotation},#{@symbol_height},200,#{@columns_encode},#{@rows_encode}^FD#{@text}^FS"
end