linux Printing: difference between ctrl+p and lpr
Dear sir,
can anyone please let me know what is the difference between ctrl+P and the lpr command with refrence to printig. what actually happens when we press ctrl+p, what kind of printing does it use to get print n how does it differ from command like Code:
lpr -P Printer filename thanks and regards rohaan |
Well, not sure about the specifics, but you directly invoke the print job via the command.
Ctrl+p on the other hand is the shortcut used in gui's and opens the pre print dialog where you can change options if required. When you click print then it should theoretically send the same command with additional option as specified by your selections. Other than that, both of them ends up with the same result, just different hoops to jump through. |
Quote:
Thanks for reply but i am trying to print a file containg hindi character it prints fine with the ctrl+p but with command line printing lpr it prints the garbage n unreadable things like box and symbols thats why i wanted to know the things related with both kind of printing. Regards Rohaan |
By creating many threads, it wont solve your problem.
|
Quote:
thats why i wanted to know the actual difference between the ctrl+p and lpr thanks for reply Reagrds rohaan |
Actually you gave no information about your GUI (KDE, Gnome, which app...) therefore it is (almost) impossible to help you.
|
I assume you are using Linux. When you print using ctrl+P, the word processor or other program you are using converts the file from its internal format to postscript and places it in a CUPS output buffer. The printer daemon sends this to the printer, using the appropriate printer driver. If it is a postscript printer, no conversion is necessary. For many printers, including most inkjets, each page of output is prepared as a graphics file, so that it is printed essentially as a picture, not as text. That is why, if the first few bytes, which are the control characters to switch the printer to graphics mode, are missed, the rest comes out as garbage, because the printer assumes it is an ASCII file.
When you save a file, you do not save the output as printed, but a possibly rather complex format depending on the program used. For example, I use Lyx as an editor for Latex. A saved file contains many control strings, specifying things like character set, case and many other things. A word processor may well save it in a binary format. Now lpr applied to such a file will assume it is ASCII, turn into postcript and write it into a buffer. Naturally, the output is garbage, with certainly no Hindi characters in it. |
Quote:
Thank you very much for your very specific help. it helped me lot. now i know what i can do to get the printing going through terminal thanks everybody for all your help and valueable time. when i will be done with solving this i will post the solution here how i did it with all your help Thanks & Regards rohaan |
Dear all,
Thanks for all the replys lpr is line printing utility so printing hindi or other language (UTF-8 data) from terminal we need to convert it to post script before we print for this i have used the following package paps-0.6.8 - Linux Code:
sudo apt-get install paps Code:
paps --encoding=UTF-8 FileName | lpr -P PrinterName Note: we also can change the LC_ALL settings from locale to LC_ALL=en_US.utf8 we can search find the way to set the locale variables Thanks & Regards rohaan THanks n regrads |
All times are GMT -5. The time now is 02:43 PM. |