class Languages::Zpl2::Barcode1D

Constants

BarcodeClasses

Public Class Methods

new(code_type, opts = {}) click to toggle source
# File lib/languages/zpl2/barcode.rb, line 20
def initialize(code_type, opts = {})
  @code = BarcodeClasses[code_type]
  @font = opts[:font] || Font.new
  @human_readable = opts[:human_readable] || "Y"
  @text = opts[:text] || ""
  @height = opts[:height] || @font.height*2
end

Public Instance Methods

render() click to toggle source
# File lib/languages/zpl2/barcode.rb, line 28
def render
  "^#{@code}#{@font.rotation},#{@height},#{@human_readable},N,N^FD#{@text}^FS"
end