Skip to content

Commit

Permalink
Merge pull request #41 from LagTag/print_zpl_files
Browse files Browse the repository at this point in the history
Ability to pass ZPL string to PrintJob
  • Loading branch information
mtking2 authored Oct 31, 2019
2 parents b1bf18b + 116db48 commit fbb7cf8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/zebra/print_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ def initialize(printer)

def print(label, ip)
@remote_ip = ip
tempfile = label.persist
if label.is_a? String
tempfile = Tempfile.new "zebra_label"
tempfile.write label
tempfile.close
else
tempfile = label.persist
end
send_to_printer tempfile.path
end

Expand Down

0 comments on commit fbb7cf8

Please sign in to comment.