CUPS
(→Installing CUPS) |
m (→Install a Parallel Printer) |
||
Line 34: | Line 34: | ||
In this case, add the port cups-pstoraster or the cups meta-port. | In this case, add the port cups-pstoraster or the cups meta-port. | ||
− | #pkg_add -r cups-pstoraster | + | # pkg_add -r cups-pstoraster |
or | or | ||
− | #pkg_add -r cups | + | # pkg_add -r cups |
Now open /usr/local/etc/cups/mime.convs in an editor as root and add or uncomment the line linking pstoraster to the mime type application/postscript. | Now open /usr/local/etc/cups/mime.convs in an editor as root and add or uncomment the line linking pstoraster to the mime type application/postscript. | ||
Line 46: | Line 46: | ||
Restart the cups daemon | Restart the cups daemon | ||
− | #/usr/local/etc/rc.d/cupsd restart | + | # /usr/local/etc/rc.d/cupsd restart |
and try to print a test page. | and try to print a test page. |
Revision as of 08:02, 24 January 2008
CUPS (Common Unix Printing System) This makes it easy to add printers to your system and programs such as firefox will pick up the printer list automatically.
Contents |
Installing CUPS
# pkg_add -r cups
or
# cd /usr/ports/print/cups # make install clean
Note that the port installed by sysinstall (for FreeBSD 6.2 at least) is cups-base and much fucntionality is missing so you may want to add the above port even if you installed cups when you installed FreeBSD. As well, cups-base (and perhaps cups) does not create a directory for CUPS log files. They can be very handy for debugging so create one this way:
# mkdir /var/log/cups
Install a Parallel Printer
If you use an old parallel printer then you need to do the following before you add the printer through cups:
# chown root:cups /dev/lpt0 # chmod 0660 /dev/lpt0
Now add these lines to /etc/devfs.conf so that the permissions are set during boot time
own /dev/lpt0 root:cups perm /dev/lpt0 0660
Turn on your printer and let it boot up. You should also make sure that it is "On Line". Now go back into the cups setup http://localhost:631 and add your printer, you will notice that there is now a Parallel device present.
After installing a printer try printing a test page. If you are using a non-Postscript printer you may get the error:
Unsupported format 'application/postscript'
In this case, add the port cups-pstoraster or the cups meta-port.
# pkg_add -r cups-pstoraster or # pkg_add -r cups
Now open /usr/local/etc/cups/mime.convs in an editor as root and add or uncomment the line linking pstoraster to the mime type application/postscript.
application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
Restart the cups daemon
# /usr/local/etc/rc.d/cupsd restart
and try to print a test page.
Installing a PCL printer
If you have a printer which handles PCL but not PS then you need to install the 'hpijs' port
# portinstall -P hpijs
Now you will have a huge list of HP printers to select from, if you have a basic B&W laser printer which accepts PCL then use the 'HP LaserJet 5L Foomatic/hpijs' driver and you shouldn't have a problem.
Printing from Windows XP to a FreeBSD CUPs server
You don't require samba to print from an XP client through a FreeBSD CUPs server to your printer. It's easier to do this without samba actually. It doesn't matter if you have samba installed though.
Simply get your printers working under CUPs and on the local server and test these. Then on the windows box add a new network printer and point that printer to your server by using the URL section of the wizard.
For example
http://<server>:631/printers/<printer name>
Then you will be able to have full rights of that printer on each windows box.
KDE Setup
You can setup any non KDE applications such as Openoffice to use the KDE printer dialogue by setting up the default printer of that applications as:
kprinter -stdin
Openoffice
Change the default printer in openoffice spadmin program
xpdf
Add the following to /usr/X11R6/etc/xpdfrc config file.
psFile "|kprinter -stdin"
CUPS to PDF
CUPS can also be used to print directly from any program to a PDF file.
# pkg_add -r cups-pdf
CUPS mimics lpr
If you have old programs which use lpr to print then you should install CUPS-lpr
# pkg_add -r cups-lpr
CUPS Troubleshooting
CUPS with proxy
Make sure if you run a proxy to set localhost in the exceptions of your browser. Should now be able to connect to http://localhost:631
CUPS and KDE Error
If you get an error in KDE print manager such as: cups host not found.
Then change the host from host: /var/run/cups.sock to host: localhost
CUPS and Gnome Warning
I've installed CUPS on a few machines and found everytime I do I cannot print though any gnome based application. If you like to use gnome applications to print your work, don't install CUPS just use LPD.
programs which crashed right out when printing were: gedit, abiword, gnumeric, inkscape.
Error you will get
(gdb) run Starting program: /usr/X11R6/bin/gnumeric Program received signal SIGBUS, Bus error. [Switching to Thread 3 (LWP 100326)] 0x29dfd450 in ippWriteIO (dst=0x8542000, cb=0x29dfa3bc <httpWrite>, blocking=1, parent=0x0, ipp=0x8517880) at ipp.c:1418 1418 ipp.c: No such file or directory. in ipp.c