How do you send printer codes to an IP printer

We were printing to a serial laser printer with all the HP codes to generate a form (i.e. lines, boxes, etc.) Thus the file is filled w/ control codes. We are switching to an IP printer and we can no longer print directly to the device (i.e. cp text /dev/tty11). It looks like we have to use the lp spooler now. When we do this the codes are ignored as the line is too long. Is there away to send raw text to an IP printer that is using the Jet Direct card to setup the queues? I saw an stty option on the lp command, can that be used to put it in raw mode?

Thanx for your help
Jeff

Please read the rules:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.

This is an exact duplicte of this thread.

I have had similar problems myself. It turns out that if you are using an HP Jetdirect of any type (internal or external) that the "raw" port is 9100. If you copy a file to that port on the jetdirect it will print. You can test this by telneting to the printer with the following command:
telnet printer_name_or_ip_here 9100
Type some stuff here
^L (for a page feed)
^d (to end, or for my telnet, you can also use ^]quit )