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

Network printer - how to send escape sequences?

For the old QNX2 and QNX4 RTOS

Network printer - how to send escape sequences?

Postby Pilotek » Thu Sep 22, 2016 8:27 am

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.
Last edited by Pilotek on Tue Sep 27, 2016 5:46 am, edited 3 times in total.
Pilotek
Senior Member
 
Posts: 137
Joined: Thu Jan 25, 2007 3:52 pm

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

Postby Pilotek » Mon Sep 26, 2016 6:15 am

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?
Pilotek
Senior Member
 
Posts: 137
Joined: Thu Jan 25, 2007 3:52 pm

Re: Network PCL+PS printer - escape sequences?

Postby Linkman » Mon Sep 26, 2016 12:39 pm

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
Linkman
New Member
 
Posts: 7
Joined: Tue Sep 20, 2016 11:52 am

Re: Network printer - how to send escape sequences?

Postby Pilotek » Fri Sep 30, 2016 6:13 am

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?
Pilotek
Senior Member
 
Posts: 137
Joined: Thu Jan 25, 2007 3:52 pm

Re: Network printer - how to send escape sequences?

Postby Linkman » Mon Oct 03, 2016 4:25 pm

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
Linkman
New Member
 
Posts: 7
Joined: Tue Sep 20, 2016 11:52 am

Re: Network printer - how to send escape sequences?

Postby Pilotek » Fri Jan 17, 2020 10:27 am

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?
Pilotek
Senior Member
 
Posts: 137
Joined: Thu Jan 25, 2007 3:52 pm

Re: Network printer - how to send escape sequences?

Postby maschoen » Sat Jan 18, 2020 6:14 am

Pilotek wrote: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.
maschoen
QNX Master
 
Posts: 2720
Joined: Wed Jun 25, 2003 5:18 pm

Re: Network printer - how to send escape sequences?

Postby Pilotek » Thu Jan 23, 2020 8:14 am

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.
Pilotek
Senior Member
 
Posts: 137
Joined: Thu Jan 25, 2007 3:52 pm

Re: Network printer - how to send escape sequences?

Postby maschoen » Thu Jan 23, 2020 6:50 pm

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.
maschoen
QNX Master
 
Posts: 2720
Joined: Wed Jun 25, 2003 5:18 pm


Return to QNX2 and QNX4

Who is online

Users browsing this forum: No registered users and 2 guests

cron