Created
July 11, 2017 20:27
-
-
Save zflat/4d2729fb0bcf3091f30fa7cbf9fc4008 to your computer and use it in GitHub Desktop.
Printer Job Language sending commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
require 'socket' | |
# use printer IP address here | |
sock = TCPSocket.new('000.000.000.000', '9100') | |
# Start | |
sock.write "\u{001B}%-12345X@PJL\n" | |
# commands | |
sock.write "@PJL RDYMSG DISPLAY=\"Hello\"\n" | |
sock.write "@PJL Echo Acme # 123\n" | |
sock.write "@PJL USTATUS DEVICE = ON \n" | |
# End | |
sock.write "\u{001B}%-12345X\r\n" | |
# sock.each_line do |line| | |
# puts line | |
# end | |
sock.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment