lib/easyzpl/label.rb
def text_field(text, x, y, params = {})
      x = 0 unless numeric?(x)
      y = 0 unless numeric?(y)
      options = { height: 0.1,
                  width: 0.1 }.merge!(params)
      label_data.push('^FO' + Integer(x * printer_dpi).to_s + ',' + Integer(y *
                      printer_dpi).to_s)

      if params[:orientation] == :landscape
        label_data.push('^A0N,')
      else
        label_data.push('^A0B,')
      end

      label_data.push(Integer(options[:height] * printer_dpi).to_s + ',' +
                      Integer(options[:width] * printer_dpi).to_s + '^FD' +
                      text + '^FS')

      # return unless label_height > 0 && label_width > 0
      # pdf.text_box text, at: [x, label_width - y -
      #                    Integer((options[:height] * pdf_dpi) / 10)],
      #                    size: (options[:height] *
      #                    pdf_dpi) if label_height && label_width
    end
def text_field(text, x, y, params = {})
      x = 0 unless numeric?(x)
      y = 0 unless numeric?(y)
      options = { height: 0.1,
                  width: 0.1 }.merge!(params)
      label_data.push('^FO' + Integer(x * printer_dpi).to_s + ',' + Integer(y *
                      printer_dpi).to_s)

      if params[:orientation] == :landscape
        label_data.push('^A0N,')
      else
        label_data.push('^A0B,')
      end

      label_data.push(Integer(options[:height] * printer_dpi).to_s + ',' +
                      Integer(options[:width] * printer_dpi).to_s + '^FD' +
                      text + '^FS')

      # return unless label_height > 0 && label_width > 0
      # pdf.text_box text, at: [x, label_width - y -
      #                    Integer((options[:height] * pdf_dpi) / 10)],
      #                    size: (options[:height] *
      #                    pdf_dpi) if label_height && label_width
    end
Prints text