CUPS printing and control escape codes

I ported application from SysV to Linux and run into troubles with printing.

Application uses lp and HP JetDirect-based printers, it inserts HP control codes in the file and uses plain lp -d dest doc-file command to print it.

The Linux (Ubuntu 8) has CUPS system, which I am not familiar with. I added JetDirect's IP to the hosts and used The UNIX and Linux Forums - Learn UNIX and Linux from Experts interface to add the printer, its model was in the list (this is HP P2015n) and the test print worked like a charm. but when I run app and print from it the control codes in the file body are not recognized as a control sequence characters, but rather as a plain text and printed along with the actual text. I captured the file from the app and tried to print it with -o raw option,

lpr -P lpr5 -o raw prtfile

but result is the same, control codes are treated as a part of the text.

Any help on how to tune up this CUPS would be appreciated.