To communicate with an HP JetDirect card, you can use lpd protocol or
telnet to port 9099 or 9100.

For lpd protocol, use queue names raw or text. Queue text will probably do
text-to-PostScript or text-to-PCL conversion, and queue raw will accept
PostScript or PCL.

There seems no difference between telnet connections to port 9099 and 9100.
Only one simultaneous connection seems to be accepted. Once a telnet
connection is established, older (pre-1998) printers refuse connections to
the either these ports or the lpd port; newer (post-2000) printers accept
the connection but seem to be ignore the data sent. If we set idle_timeout
to 0 then we could 'hog' the only allowed connection.

#################
# * All PJL jobs must begin and end with a
# Universal Exit Language (UEL) command
# "<ESC>%-12345X". This command exits the
# current printer language and returns
# control to PJL.
# * The UEL command at the beginning of the
# job must be immediately followed by the PJL
# command prefix "@PJL". The "@PJL" may be
# the prefix of another PJL command. Or, if
# the command is ended with the "@PJL" then
# it must be followed by a linefeed
# character. A carriage return is optional.
# No other characters, including control
# characters, are allowed between the UEL
# command and the @PJL prefix (see any of the
# examples below).
# * The UEL command at the job end must not
# be followed by anything (except the first
# character of the next job).
# * Line Termination--a line feed character
# is required to terminate all PJL commands
# except the UEL command. A carriage return
# can precede the terminating line feed;
# however, the carriage return is optional
# and is ignored.
# * No blank command lines are allowed.
#
# Often you would then use the sequence:
# <ESC>%-12345X@PJL
# @PJL JOB
# @PJL command1
# @PJL command2
# @PJL EOJ
# <ESC>%-12345X
#
# What does this do?:
# @PJL SAVETIME
#
#
# Four Levels of Control Panel Lock (CPLOCK)
# @PJL DEFAULT CPLOCK=MINIMUM
#   MINIMUM Menus that are unlocked: Information, Paper Handling, Print Quality, EIO
# @PJL DEFAULT CPLOCK=MODERATE
#   MODERATE Menus that are unlocked: Information, Printing
# @PJL DEFAULT CPLOCK=MAXIMUM (or ON)
#   MAXIMUM Menus that are unlocked: (none)
# @PJL DEFAULT CPLOCK=NONE (or OFF)
#   OFF Menus that are unlocked: (all)
#
# Password
# @PJL DEFAULT PASSWORD=[numeric password 1 to 65535, 0 disables]
# @PJL JOB PASSWORD = value [if password has been set]
#
# Common PJL Commands
# @PJL COMMENT some text to ignore
# @PJL ECHO "text to show"
# @PJL ENTER LANGUAGE = PCL, POSTSCRIPT, ESCP [finish with <ESC>%-12345X@PJL]
# @PJL INITIALIZE [NOTE: Use Initialize, not Reset]
# @PJL OPMSG DISPLAY="MESSAGE" [NOTE: will wait for operator to press GO]
# @PJL RDYMSG DISPLAY="MESSAGE"
# @PJL RESET [NOTE: What does this do?]
# @PJL SET TESTPAGE=SELFTEST, CONTSELFTEST, PCLTYPELIST, PCLDEMOPAGE, PSCONFIGPAGE, PSTYPEFACELIST, PSDEMOPAGE
# @PJL STMSG DISPLAY="MESSAGE" [NOTE: will wait for operator to press a key]
# @PJL USTATUSOFF [NOTE: What does this do?]
#
# To change settings for just the current job, replace "DEFAULT" with
# "SET", or with "USTATUS" (what does that do?).
# @PJL DEFAULT AUTOCONT=ON or OFF
# @PJL DEFAULT BINDING=LONGEDGE or SHORTEDGE
# @PJL DEFAULT COPIES=1 to 999
# @PJL DEFAULT COURIER=DARK
# @PJL DEFAULT DENSITY=1, 2, 3, 4 or 5
# @PJL DEFAULT DUPLEX=ON or OFF
# @PJL DEFAULT ECONOMODE=ON or OFF
# @PJL DEFAULT FINISH = STAPLE
# @PJL DEFAULT FORMLINES=5 to 128
# @PJL DEFAULT JOBOFFSET=ON or OFF
# @PJL DEFAULT LPARM : PCL FONTNUMBER=2
# @PJL DEFAULT LPARM : PCL PITCH=.44 to 99.99
# @PJL DEFAULT LPARM : PCL PTSIZE=4 to 999.75
# @PJL DEFAULT LPARM : PCL SYMSET=PC8
# @PJL DEFAULT MANUALFEED=ON or OFF
# @PJL DEFAULT MEDIATYPE = paper, glossy, TRANSPARENCY, special
# @PJL DEFAULT MPTRAY=FIRST or CASSETTE
# @PJL DEFAULT ORIENTATION=LANDSCAPE
# @PJL DEFAULT OUTBIN=UPPER, LOWER, SIDE, bin1, bin2
# @PJL DEFAULT PAPER=Letter, Legal, Executive, Ledger, Com10, B4, B5, Custom, JISB4, JISB5, JPost, JPostD, A3, A4, C5, DL, Monarch
# @PJL DEFAULT POWERSAVE = ON or OFF
# @PJL DEFAULT POWERSAVETIME = 15, 30, 60, 90, 120 [or other values of minutes?]
# @PJL DEFAULT PRINTERNAME=XXXXXXX
# @PJL DEFAULT PRINTQUALITY = draft, normal, high
# @PJL DEFAULT PS:MBT=ON, OFF, or AUTO [NOTE: Memory Booster Technology]
# @PJL DEFAULT RENDERMODE = COLOR, GRAYSCALE
# @PJL DEFAULT RESOLUTION = 300, 600, 1200
# @PJL DEFAULT RET=ON, OFF, LIGHT, MEDIUM OR DARK [NOTE: RET is Resolution Enhancement]
#
# Where would the info be returned?
# @PJL INFO PAGECOUNT [Shows: number]
# @PJL INFO STATUS [Shows: CODE=number nl DISPLAY="str" nl ONLINE=TRUE or FALSE]
# Seems that we can INQUIRE most anything that we can SET
# (what is the difference between DINQUIRE and plain INQUIRE?):
# @PJL INQUIRE CPLOCK [Shows: ON or OFF]
# @PJL INQUIRE PASSWORD [Shows: ENABLED or DISABLED]
# @PJL INQUIRE POWERSAVE [Shows: ON or OFF]
# @PJL INQUIRE POWERSAVETIME [Shows: number]
#
#########################################
#### PS level 1 stuff we may want to know
# echo "0 setoutputtray" # up output bin (face down)
# echo "1 setoutputtray" # back output bin (face up)
# echo "executivetray"
# echo "lettertray"
# echo "legaltray"
# echo "a5tray"
# echo "a4tray"
# echo "a3tray"
# echo "ledgertray"
# echo "11x17tray"
# echo "monarcenvelopetray"
# echo "com10envelopetray"
# echo "dlenvelopetray"
# echo "c5envelopetray"
# echo "b5envelopetray"
# echo "a6tray"
# echo "jb4tray"
# echo "jb5tray"
# echo "jb6tray"
# echo "doublepostcardtray"
# echo "singlepostcardtray"
# echo "b5envelopetray"
# echo "false setduplexmode"
# echo "true setduplexmode false settumble"
# echo "true setduplexmode true settumble"
# echo "90 rotate"
#########################################
#### PS level 2 stuff we may want to know
# echo "<<"
# echo "/DeferredMediaSelection true"
# echo "/Policies <</Duplex 1 /MediaType 2 /PageSize 2>>"
# echo "/DeferredMediaSelection true /MediaPosition $mediasrc"
# echo "/DeferredMediaSelection true /ManualFeed true"
# echo "/Duplex false"
# echo "/Duplex true /Tumble false"
# echo "/Duplex true /Tumble true"
# echo ">>setpagedevice"
#########################################