I know that printing on Linux is somewhat of an art form, but I have a fairly simple problem. I used the following command to configure a networked printer (HP LaserJet 8150):
lpadmin -p name -E -v socket://name -m laserjet.ppd -u allow:all - u deny:none
This added and enabled the printer, and I can print to it using the print command from within a GUI application and PostScript utilities like enscript. However, printing simple text files from the command line using lpr or lp produces undesirable output that looks like this:
Line 1 Line 2 Line 3
It seems rather obvious that the printer is expecting carriage returns and not getting any. What is the "right" way to fix this using CUPS, which "owns" the /etc/printcap file. I can't be the first one to run into this issue...
Thanks, Alfred
On Aug 8, 2006, at 3:21 PM, Alfred von Campe wrote:
I know that printing on Linux is somewhat of an art form, but I have a fairly simple problem. I used the following command to configure a networked printer (HP LaserJet 8150):
lpadmin -p name -E -v socket://name -m laserjet.ppd -u allow:all - u deny:none
This added and enabled the printer, and I can print to it using the print command from within a GUI application and PostScript utilities like enscript. However, printing simple text files from the command line using lpr or lp produces undesirable output that looks like this:
Line 1 Line 2 Line 3
It seems rather obvious that the printer is expecting carriage returns and not getting any. What is the "right" way to fix this using CUPS, which "owns" the /etc/printcap file. I can't be the first one to run into this issue...
Thanks, Alfred
I would use printconf instead of lpadmin. It sets up all the necessary filters. Tony
On Aug 9, 2006, at 10:04, Tony Schreiner wrote:
I would use printconf instead of lpadmin. It sets up all the necessary filters.
So printconf comes with the system-config-printer RPM, and lpadmin comes with the cups RPM. Are they "compatible" with each other? That is, can I (re)configure a printer I set up with lpadmin using printconf? I'm looking for a solution that will allow me to remotely reconfigure the printer on the dozen Linux workstations I manage. It appears the printconf is either a GUI or a TUI, but not a true command line utility, so it will be more painful to configure the remote systems.
Having said that, if there is a way to configure the printer just right on one system, and then copy all the configuration files to the remote systems, that would work for me as well. But configuring the printer just so and determining all the configuration files is where the magic lies...
Alfred
On Aug 9, 2006, at 10:30 AM, Alfred von Campe wrote:
On Aug 9, 2006, at 10:04, Tony Schreiner wrote:
I would use printconf instead of lpadmin. It sets up all the necessary filters.
So printconf comes with the system-config-printer RPM, and lpadmin comes with the cups RPM. Are they "compatible" with each other? That is, can I (re)configure a printer I set up with lpadmin using printconf? I'm looking for a solution that will allow me to remotely reconfigure the printer on the dozen Linux workstations I manage. It appears the printconf is either a GUI or a TUI, but not a true command line utility, so it will be more painful to configure the remote systems.
Having said that, if there is a way to configure the printer just right on one system, and then copy all the configuration files to the remote systems, that would work for me as well. But configuring the printer just so and determining all the configuration files is where the magic lies...
Alfred
printconf, runs printconf-backend which runs some python scripts in / usr/share/printconf. You could look there for the gory details.
as for recreating a configuration, ...possibly..., copying all the files in /etc/cups from one system to another would do it (and restarting cups). Have not tried this though. Tony Schreiner
On Tue, 2006-08-08 at 15:21 -0400, Alfred von Campe wrote:
It seems rather obvious that the printer is expecting carriage returns and not getting any. What is the "right" way to fix this using CUPS, which "owns" the /etc/printcap file. I can't be the first one to run into this issue...
I would avoid printconf - it sucks (my opinion of course, but printconf really does suck). It destroys cups.conf. Instead, use foomatic-configure to set up/configure your print queue(s) for CUPS. It's simple to use. For example:
foomatic-configure -s cups -n epson -N "Epson Stylus Color 600" -L "Office" -c file:/dev/lp0 -d gimp-print-ijs -p Epson-Stylus_Color_600
Most of that is self-explanatory. The "tricky" part is finding out which driver to use ("-d"), and what the Foomatic ID is for your printer ("-p"). The driver bit you can determine by going to the www.linuxprinting.org. The ID can be determined by greping the foomatic database. For example:
foomatic-configure -O | grep Epson- | sort | less
BTW, if you end up at www.linuxprinting.org, you can download the driver for your printer from there too, in which case you don't have to use foomatic-configure.
For more detailed steps, refer to this:
http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/II.Foomatic...
HTH,
Ranbir
On Aug 9, 2006, at 13:14, Kanwar Ranbir Sandhu wrote:
I would avoid printconf - it sucks (my opinion of course, but printconf really does suck). It destroys cups.conf.
Yes, I was afraid that printconf might not play nicely with CUPS.
Instead, use foomatic-configure to set up/configure your print queue(s) for CUPS. It's simple to use. For example:
OK, now there is a command I've never heard of before. Interesting naming choice. From a brief perusal of the man page, this seems to be exactly what I need.
Most of that is self-explanatory. The "tricky" part is finding out which driver to use ("-d"), and what the Foomatic ID is for your printer ("-p").
Well, considering I have an HP LaserJet, I don't think I will have a problem finding the driver.
For more detailed steps, refer to this:
http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/ II.Foomatic-User/II.tutorial-handout-foomatic-user.html
Excellent! Thanks for the pointers. This will be very helpful.
Alfred
On Aug 9, 2006, at 13:14, Kanwar Ranbir Sandhu wrote:
I've been away for a while, so I am just trying this now.
Instead, use foomatic-configure to set up/configure your print queue(s) for CUPS. It's simple to use.
I read the man page, and configured the printer using foomatic- configure using the following command:
foomatic-configure -s cups -n <printername> -N "HP LaserJet 8150" \ -c socket://<printername> -d Postscript -p HP-LaserJet_8150
It's working much better. Printing from any GUI application works just fine. Printing plain text files from the command line using lpr now properly includes carriage returns. However, the first 1.5 or so characters are chopped off the left margin (the second half of the second character is the first thing that prints), and the lines are truncated if they exceed the width of the page. Now I know I can use something like enscript, which works just fine, but I was wondering if there is a way to configure the printer so that lpr doesn't chop off the beginning and end of the line.
Thanks, Alfred
On Wed, 2006-16-08 at 10:15 -0400, Alfred von Campe wrote:
Now I know I can use something like enscript, which works just fine, but I was wondering if there is a way to configure the printer so that lpr doesn't chop off the beginning and end of the line.
You can configure print options for the printer queue with foomatic-configure. But, since you've already set up the printer, use can use lpoptions.
I think all the options for lpoptions are documented in the CUPS docs. You can easily get to them by going to http://localhost:631 on the box where you set up the printers (or from somewhere else on the network, if you configured CUPS to give admin access to remote hosts).
You can set system wide queue default options; per-user defaults are available too: just create a ~/.lpoptions file. You can copy the syntax for the file from the system wide version (/etc/cups/lpoptions).
HTH,
Ranbir
On Aug 16, 2006, at 13:43, Kanwar Ranbir Sandhu wrote:
I think all the options for lpoptions are documented in the CUPS docs. You can easily get to them by going to http://localhost:631 on the box where you set up the printers (or from somewhere else on the network, if you configured CUPS to give admin access to remote hosts).
I've perused (some of) the CUPS docs, but I haven't found anything that controls printing plain text files with lpr. Using enscript, which converts a text file to PostScript works just fine. Worst case, I'll tell all the users to always use enscript. But it's bugging me that I can't fix the lpr issue.
Alfred
On Wed, 2006-16-08 at 16:37 -0400, Alfred von Campe wrote:
I've perused (some of) the CUPS docs, but I haven't found anything that controls printing plain text files with lpr. Using enscript, which converts a text file to PostScript works just fine. Worst case, I'll tell all the users to always use enscript. But it's bugging me that I can't fix the lpr issue.
Have you tried the -o option for lpr?
(BTW, /usr/bin/lpr is a symlink to /etc/alternatives/print, which is a symlink to /usr/bin/lpr.cups).
Regards,
Ranbir
On Aug 16, 2006, at 22:05, Kanwar Ranbir Sandhu wrote:
Have you tried the -o option for lpr?
No, but I just read the lpr man page, and it just says that you can set a job option with -o, but there is no mention of what job options are available. But the -p option may help. I'll have to try it tomorrow when I'm back at work.
(BTW, /usr/bin/lpr is a symlink to /etc/alternatives/print, which is a symlink to /usr/bin/lpr.cups).
Very interesting, I had not noticed that. Thanks for pointing it out. I'm learning new things about printing on Linux every day. For now, I think we'll just use enscript to work around this issue.
Alfred