class PDFDirectPrint::RawPrint

Raw network printing using TCP port 9100 of network-enabled printer

Attributes

error_message[R]

Public Class Methods

new(options) click to toggle source
# File lib/pdfdprint/raw_print.rb, line 9
def initialize(options)
  @options = options
  @pjl = setup_pjl
end

Public Instance Methods

print(file) click to toggle source

Private Instance Methods

setup_pjl() click to toggle source
# File lib/pdfdprint/raw_print.rb, line 34
def setup_pjl
  pjl = {}
  pjl['escapeseq']  = "#{27.chr}%-12345X\@PJL#{13.chr}#{10.chr}"
  pjl['input1']     = "\@PJL SET MEDIASOURCE = TRAY#{@options[:tray]}#{13.chr}#{10.chr}"
  pjl['input2']     = "\@PJL SET RESOLUTION = #{@options[:resolution]}#{13.chr}#{10.chr}"
  pjl['input3']     = "\@PJL SET PAPER = #{@options[:format]}#{13.chr}#{10.chr}"
  pjl['lang']       = "\@PJL ENTER LANGUAGE = PDF#{13.chr}#{10.chr}"
  pjl
end