print using cat command

:question:
When I use cat command for printing in QNX6.2.1, my file gets printed but the start of lines are disturbed(seems carriage return does not work)
The file appearing like this,

This is printer testing.
Teting done with HP printer.

In the above file ,
first line is printed as such whereas
second line starts at the end char of first line and so on…

The line feed works and each line of the file gets printed in seperate lines but it does not start from the begining of the line.

Can anyone suggest how to overcome this problem.

With Regards,
M.Shanthi.

not sure, but perhaps it’s because of UNIX file format using only LF at the end of a line.
Try to convert the file to DOS mode (textto -c file) which uses CR/LF.

Thanx a lot. It did work.
But, a new problem has cropped in. My cat command is performed only after I give a command from ped editor screen or helpviewer. I think I’m not starting the printer properly in the way ped editor/ helpviewer does.

Have you read the Printing chapter of the Neutrino User’s Guide? It describes how Photon sends stuff to the printers.

I’ve read enough of the Printing chapter in QNX Neutrino User’e Guide and tried using lpr command also.But the /var/log/syslog file always says that “lpd failed to obtain lock lpd.lock” and so my lprc status shows
that
“1 entry in queue.
no daemon present”

I’m not sure what’s going on?

Sometimes when lpd dies, it leaves the lock file behind. Use pidin to see if lpd is running; if it isn’t, delete /usr/spool/output/lpd.lock (you need to be root to do this).

I’ve deleted lpd.lock but of no use.Using pidin i found that lpd is still running. Also, I’ve restarted lpd and checked. still the same problem was happening.

My requirement is to print a file (test.dat) from my Photon code on a print button press. Can anyone suggest me some alternative method? Orelse, if I know how QNX has done “print” for its helpviewer,mozilla or ped editor wud be fine.

Regards,
M.Shanthi