Network printer - how to send escape sequences?

Please help.

In our old application (QNX 4.25, Photon 1.13) we used LPT connected laser printer (PCL compatible) for printing of plain text data tables on operator’s demand. Because the tables were too wide to fit into common A4 paper sheet (even landscape oriented) before printing each text table (operator’s pressing the “Print Table” icon) we have sent control codes to the printer to change the font size, pitch etc.:

echo “\033(10U\033(s0p16.67h8…” >/dev/par

We had to change the printer for a network printer (own IP address) Samsung Xpress C467W. We succeeded to set it up for printing the tables:

lpr -Pprintername filename, but the font size is default and they won’t fit the paper width (landscape paper orientation is not sufficient).

Question: Is there a way to send some control characters to [Samsung Xpress C467W] network printer to change the default font/pitch to a small one?

  • Is it even possible to send escape codes to a network printer with own IP address?

  • What should the printer be compatible with to understand (accept) Escape control sequences? The printer is PCL and PostScript compatible - we succeeded in Photon graphics (window screenshot) color printing with both Pcl and Ps filters.

  • Or is there some other way to force the network printer [Samsung Xpress C467W] to change the text font size/pitch before plain text file printing?

Thank you.

Well, maybe the questions are not completely clear…

What is the “command” (or configuration file) and syntax for sending printer control sequences (escape sequences) to network attached printer (own IP address, PCL and PostScript compatible) under QNX 4?

You might want to work this using a different method. Since your printer works with Postscript you might convert plain text files being printed to Postscript. In Unix I have used the a2ps command to get around printers converting plain text to their own strange formats. While I have little experience with QNX printing, it does appear that it has a similar feature (search for a2ps): … ml?lang=kr

Thank you Linkman, a2ps looks interesting. But I cannot find where to download a2ps for QNX4.

And also ghostscript utility (convert PS to PCL) - do you anybody know where to download it for QNX4?

The link I posted for QNX print spooling has this which implies a feature similar to the a2ps command:

ci=a2ps -H"$(file)" | awk '/%%EndProlog/ { print "<< /Duplex \ true >> setpagedevice"; } { print $0; }' co=echo $(username)"\n" "put" $(spfile) | SOCK=666 /usr/ucb/ftp net_printer

Please is there a simple way in QNX4 (command) how to set a network printer (own IP address) to change the paper orientation (to Landcape) before printing the text file?

I don’t think this has to do with QNX. If the printer supports PCL there is an escape sequence. I’m not sure how its done with PostScript.

Maybe I can’t explain my need in a clear way… I only need equivalent of QNX “command”:

echo “\033(10U\033(s0p16.67h8…” >/dev/par - conventional printer connected to LPT port

for the new network attached printer (with own IP address).

Or is it not possible to send “raw” Escape sequences to a network printer from QNX4 before printing simple text document? You know, I need this for modifying existing old SCADA system to print to a new printer.

You are making it unclear as to what the difficulty might be.

  1. Yes you can just send raw charactors to a QNX printer device, eg. /dev/lpt. You might want to check and change the the printer properties with stty first to make sure there is no changing anything such as “\n” → CR LF.

  2. There is no standard driver that converts an IP address to a serial device such as /dev/lpt.
    This can be done. At the lower level you have to open the correct IP:Port and use the TCP/IP protocol to send the data.

  3. I think Photon might have had a utility to move data to a network printer, but I’m not sure. Having done this, I could look up how I did it and let you know. Just ask.