Skip navigation.
Home
The QNX Community Portal

View topic - Network printer - how to send escape sequences?

Page 1 of 1

Network printer - how to send escape sequences?

PostPosted: Thu Sep 22, 2016 8:27 am
by Pilotek
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.

Re: Network PCL+PS printer - send escape sequences?

PostPosted: Mon Sep 26, 2016 6:15 am
by Pilotek
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?

Re: Network PCL+PS printer - escape sequences?

PostPosted: Mon Sep 26, 2016 12:39 pm
by Linkman
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):

http://www.qnx.com/developers/docs/qnx_ ... ml?lang=kr

Re: Network printer - how to send escape sequences?

PostPosted: Fri Sep 30, 2016 6:13 am
by Pilotek
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?

Re: Network printer - how to send escape sequences?

PostPosted: Mon Oct 03, 2016 4:25 pm
by Linkman
The link I posted for QNX print spooling has this which implies a feature similar to the a2ps command:

Code: Select all
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