Differences between revisions 1 and 83 (spanning 82 versions)
Revision 1 as of 2004-01-11 21:34:13
Size: 311
Editor: anonymous
Comment:
Revision 83 as of 2015-06-17 11:46:19
Size: 14604
Editor: Brian Potkin
Comment: Changed Tea4cups to Tea4CUPS
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## Auto-converted by kwiki2moinmoin v2005-10-07
Tips on setting up, and using printers under Debian

Perhaps a link to wiki page PrintingConfiguration would help.

A great place is http://www.linuxprinting.org . Lots of information on specific printers in addition to CUPS and foomatic printing configuration.
#language en
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: [[ar/SystemPrinting|العربية]] - [[el/SystemPrinting|Ελληνικά]] - English - [[fr/SystemPrinting|Français]] - [[it/SystemPrinting|Italiano]] - [[pl/SystemPrinting|Polski]] - [[ru/SystemPrinting|Русский]] - [[zh_CN/SystemPrinting|简体中文]] -~
----
<<TableOfContents(2)>>
= Debian Printing (CUPS) =
Keywords: Linux Printing, Debian, cups system, HP Linux and Image software, Install, Add , Change Printers, Print Server.

The Common UNIX Printing System (or CUPS) is a printing system and general replacement for lpd and other older systems. The CUPS Debian packages forms a nice, powerful and relatively easy to use printing system on Debian. (http://www.cups.org/)

== Installation ==
 *Install Software:
{{{
aptitude update
aptitude install cups cups-client
}}}
 *Start the software:
{{{
/etc/init.d/cups start
}}}

== Add Printer ==
 *Now you can add a printer by going to
{{{
http://localhost:631/
}}}
and adding a printer via the Administration screen. If you get a permission error, try adding yourself to the group lpadmin. E.g. if you are user "tom":
{{{
sudo usermod -a -G lpadmin tom
}}}
Be aware that cups has been observed to not handle passwords longer than 32 characters. (Seen in version 1.5.3-5+deb7u4 .)
 *[OPTIONAL]If you are in server environment and you do not have a browser like Firefox, you will need to install a text browser like lynx or elinks.
{{{
aptitude install lynx-cur
}}}
or
{{{
aptitude install elinks
}}}
 *Now go with the text browser to the same address as specified before.
{{{
 elinks http://localhost:631/
}}}
 *Follow the instructions you see on the screen. Set the default printer.

{{attachment:HomeCups.png}}

== Example, kyocera printer ==
 *Type in:
{{{
elinks http://localhost:631/
}}}
 *Click on '''Do Administration Task''', then '''Add New Printer''',
{{{
Name: kyocera9520
Location: Back Room
Description: High output printer
}}}
 *Click '''Continue'''
 *Click on '''!AppSocket/HP !JetDirect'''
 *If you have a network printer that you can directly print to, select:
{{{
LPD/LPR Host Printer
}}}
 *Then change a device URI to one of the examples:
{{{
socket://hostname:9100
}}}
 *Then select '''Make'''.Then '''Model'''. If your model is not there, you can try picking similar printer number/driver and it should work.
 *When done go back to original menu. Click on '''Set Default Printer'''
 *Done. __ Anything below is optional __

== Printer Status ==
 *Is the printer running?
{{{
lpstat -r
}}}
 *What is the default printer?
{{{
lpstat -d
}}}
 *Printer queue
{{{
lpq
}}}

== Print to a PDF ==
You may not have a physical printer but need to get a document ready to print then you could to a PDF file.

First you'll need to install cups-pdf by running the following:
{{{
aptitude install cups-pdf
}}}

Once completed you need to setup the printer in Gnome as follows. Go to:
{{{
System--> Administration--> Printing
}}}

This will bring up a list of printers and in here you'll see an icon Add Printer

Now follow the steps as defined below:
{{{
Select "Local Printer" and use a "detected printer --> PDF printer".
Manufacturer --> Generic,
Model --> postscript color printer rev4,
Driver --> Standard
Apply
}}}

Finally you'll get a PDF folder in your Home.

=== CUPS Administration ===
 *CUPS can also be administered via its web interface (http://localhost:631). You will be asked for the root user login and password.
 *Any other setting can be done through the easy web interface or using a print settings program as root:
{{{
http://localhost:631/
}}}
 *Options include: pause, resume, cancel print jobs, etc.
 *[Optional]You can also login to the web interface as any user in the "lpadmin" group

= No Printer Drivers =
Most of the more common printer should already have drivers in cups system. For the newer or more commercial ones see the manufacture website. You should look for the PPD file of your printer model. The PPD file describes the capabilities of the printer. For a comprehensive review and database of printer models, drivers and PPD files see http://www.linuxprinting.org

== Brother ==
 * [[http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html|cupswrapper driver]]
 * For some printers you can download and install [[http://welcome.solutions.brother.com/bsc/public/us/us/en/dlf/dlf/000000/006800/dlf006893.html?reg=us&c=us&lang=en&prod=mfc240c_all&type2=91&os=128&flang=4&dlid=dlf006893 | Linux-brprinter-installer]]

== Canon ==
 * Option 1: '''UFR II'''. [[https://wiki.debian.org/PrinterDriver/Canon/UFR-II|How-to install "Canon UFR II Printer Driver for Linux". Works with a wide range of Canon models and series.]]
 * Option 2: '''PDD'''. For copier/printer/scanner like Imagerunner 5065
  1. Download the PPD drivers: http://downloads.canon.com/cpr/software/imagerunner/PPD_v241.exe
  1. Run it using wine. This will unzip the PPD to temp folder. Find your printer and use the QX PPD drivers.

== HP ==
Install hplip package. For new printers, it may be necessary to download and install hplip directly from the project web site. Check your printer here: [[http://hplipopensource.com/hplip-web/supported_devices/index.html| HPLIP supported printers ]]. This page will show the version of hplip required by your model. Setup the printer by running `hp-setup` (see below).

== Kyoceramita (PPD) ==
 *[[http://usa.kyoceramita.com/KMAGlobalpub/jsp/Kyocera/resource_details.jsp?rid=17845|Kyocera PPD drivers]]

== Samsung ==
 * [[http://www.bchemnet.com/suldr/index.html|The Samsung Unified Linux Driver Repository]]

= Alternative Automatic Configuration =
== system-config-printer (formally 'printconf') ==
[[http://cyberelk.net/tim/software/system-config-printer/ | system-config-printer ]] is a printer administration tool which first appeared in Fedora and later in Debian and Ubuntu. The purpose of the tool is to configure a CUPS server (often the local machine) using the CUPS API. The tool is written in Python, using pygtk for the graphical parts and with some Python bindings (pycups) for the CUPS API.

It is largely the same as using the CUPS web interface for configuring printers, but has the advantage of being a native application rather than a web page.

== HP printer setup with 'hp-setup' ==
hp-setup is included with HP Linux Imaging & Printing project package DebPkg:hplip and performs setup of USB, parallel, and network printers and All-in-Ones. Network printers are automatically detected via mDNS (aka Bonjour on Macs). Using hp-setup to install printer also enables hp utilities for checking ink/toner level and printer maintenance. Run '`hp-check -r`' to troubleshoot printing or scanning issues.

== HP LaserJet 10xx printer setup with 'printer-driver-foo2zjs' ==
Install CUPS, driver and non-free firmware downloader:
{{{
  $ sudo apt-get install cups printer-driver-foo2zjs hannah-foo2zjs
}}}
Download non-free firmware with gui:
{{{
  $ sudo hannah-foo2zjs
}}}
Re-plug USB connection to printer in order to execute `/lib/udev/rules.d/85-hplj10xx.rules` which download firmware to printer.

Visit http://localhost:631/admin and push to "Add new printer" button. Your model will be present. Check it and push "Next". Find `.pdd` setting by selecting HP and your printer model next with `Foomatic/foo2zjs-z1` variation. Set default preference (like paper size). Print test page!

= Printer Sharing =
== CUPS as Print Server for Windows Machines ==
You can setup CUPS to allow Windows machines to print to a CUPS server using an http address.

First, install the DebPkg:samba package. When you are asked to use WINS, say '''yes'''.
{{{
$ aptitude install samba
}}}

Next setup your {{{/etc/cups/cupsd.conf}}} file.
{{{
# Our private connection we listen to
Listen *:49631

# Allow machines on local network to use printers
<Location /printers>
  Order allow,deny
  Allow 192.168.0.*
  Allow 192.168.1.*
</Location>
}}}
This will listen on port 49631 from any network. You may use some other port number besides 631. Note that the dynamic and/or private ports as specified by the [[http://www.iana.org/assignments/port-numbers|IANA]] are in the range 49152 through 65535. Also, this will only allow computers from the local network to print to the CUPS printers.

Next, restart the CUPS daemon
{{{
$ /etc/init.d/cups restart
}}}

Now on each Windows machine, Choose that you want to install a network printer and that you want to install a printer on the Internet or home/office network. The URL you will use should be:
{{{
http://<cups_server_hostname>:49631/printers/<printer_name>
}}}

Lastly, the driver to install is in the {{{Generic}}} section labeled '''MS Publisher Color Printer'''.


== CUPS and Samba ==
__ This section needs updating as you can setup print server via samba print sharing just by uploading drivers. __
 
When printing to windows printers in an NT domain using SMB the Device URI should read
{{{
  smb://username:password@domain/server/printername
}}}
This allows Samba to authenticate against a domain controller for acces to the printer queue.

You may also omit the `username:password@` part when the server does not need authentification. As the `hostname` both, a windows computer name or an IP address would work.
To determine the `printername` you may use the `smbclient` command line tool.
Run the following command, where `computername` refers to the name of the machine that shares the printer:
{{{
  smbclient -L computername
}}}
Check the ouput for entries with Type "Printer":
{{{
$ smbclient -L base

 Sharename Type Comment
 --------- ---- -------
 print$ Disk Druckertreiber
 HPOffice Printer HP Officejet J4500 Series
 ADMIN$ Disk Remoteadmin
 C$ Disk Standardfreigabe
}}}

The resulting URL from the output above would be
{{{
  smb://base/HPOffice
}}}

When printing to a Debian CUPS printer from a machine that connects through Samba, you may need to [[http://www.owlfish.com/thoughts/winipp-cups-2003-07-20.html|set up a CUPS class]] to get things to work.


== Printer sharing using Macintosh as the client and Debian as the server ==
You have a printer on a debian machine and you want to share it with a Macintosh, so that the Mac can print to the Debian-based printer. Try this:

1. Use cups to set up the printer on Debian as described above. The Gnome tool for printer configuration works well, and the 100% bullet-proof way is to use the browser-based CUPS configuration.

2. On the Mac (OS X 10.4+) start `Print and Fax` from `System Preferences`. Use the + button to add a printer.

3. Look first in the "Default" tab. If the automagic printer-sharing has worked, and your Mac is connected to the local network properly, then the Debian-based printer should already be visible in the list. Just select it and use the recommended print driver. Your results may vary but you can't go to far wrong if you pick a driver that matches the one you are using on Debian. So, for example, you might like to try using Gutenprint drivers at both ends.

4. If your printer is '''not''' visible in the Default tab, then try adding it on the "IP" tab. Pick IPP as the protocol, give the plain IP address of the server in the address box, and in the Queue box put "printers/<debian-queue-name>". Put whatever helps you identify the printer in the Name and Location boxes, and choose a printer driver than matches what you used to set up the printer on Debian. Finally cross your fingers, hold your breath, recite a prayer/spell/incantation, and press the Add button.

As they say: your mileage may vary.

= Printing Pictures =
Professional looking photos may be obtained when using high quality glossy photo paper on an inkjet printer but care must be taken when submitting the print job. Printing from The Gimp image manipulation program produces very good results. The print dialog will vary depending upon the printer used. The most important settings are type of paper, glossy photo or whatever sort you are using, and image type, "photograph". The size of the printed image is adjusted in the printer dialog as well.

= Other printing Systems =
Debian has several alternatives available for printing:

 * CUPS. (Instructions above.) The newer Common UNIX Printing System (or CUPS) is a printing system and general replacement for lpd and the like. It supports the __Internet Printing Protocol (IPP)__, and has its own filtering driver model for handling various document types.
 * LPR. The still commonly used traditional printing system is called lpr which works quite well if you have a [[http://en.wikipedia.org/wiki/PostScript|postscript]] printer. Otherwise, it is not very simple to set up and doesn't provide much control for users on the printer settings per print job.
 * [[rlpr| RLPR]] Remote line printer spooling system.
 * DebPkg:xpp is designed to be able to take the same command-line arguments as BSD-lpr and SysV-lp so most apps won't realize the difference if you create a symbolic link from `/usr/bin/lpr` (or `/usr/bin/lp`) to `/usr/bin/xpp`. This way, whenever an application sends off a print job to the `lpr` (or `lp`) program, `xpp` will launch its GUI so that you can select the options that you would like for this job.

These alternatives are maintained by different groups.
But there is a lot of collaboration and coordination between them, which occurs on the [[http://lists.debian.org/debian-printing|debian-printing]] list.

= External links =
 * [[DebianPkg:system-config-printer]] - Gnome's printers configuration .
 * [[PpdFileStructureSpecification| PPD File Structure Specification]]
 * http://tldp.org/HOWTO/Printing-HOWTO
 * http://www.tldp.org/HOWTO/Debian-and-Windows-Shared-Printing/
 * http://www.linuxprinting.org
 * [[https://help.ubuntu.com/community/HpAllInOne|HP All-in-One setup and support - Ubuntu Community Wiki]]

= See also =
 * [[Teams/Printing]]
 * [[Teams/CUPS]]
 * [[Dissecting and Debugging the CUPS Printing System]]
 * [[The cupsfilter Utility]]
 * [[pdftopdf and Page Rotation]]
 * [[ThetexttopdfFilter|The texttopdf Filter]]
 * [[Tea4CUPS|Tea4CUPS]]

----

## - If this page belongs to an existing Category, add it below.
 SystemAdministration | CategoryPrinter

Translation(s): العربية - Ελληνικά - English - Français - Italiano - Polski - Русский - 简体中文


Debian Printing (CUPS)

Keywords: Linux Printing, Debian, cups system, HP Linux and Image software, Install, Add , Change Printers, Print Server.

The Common UNIX Printing System (or CUPS) is a printing system and general replacement for lpd and other older systems. The CUPS Debian packages forms a nice, powerful and relatively easy to use printing system on Debian. (http://www.cups.org/)

Installation

  • Install Software:

aptitude update
aptitude install cups cups-client
  • Start the software:

/etc/init.d/cups start

Add Printer

  • Now you can add a printer by going to

http://localhost:631/

and adding a printer via the Administration screen. If you get a permission error, try adding yourself to the group lpadmin. E.g. if you are user "tom":

sudo usermod -a -G lpadmin tom

Be aware that cups has been observed to not handle passwords longer than 32 characters. (Seen in version 1.5.3-5+deb7u4 .)

  • [OPTIONAL]If you are in server environment and you do not have a browser like Firefox, you will need to install a text browser like lynx or elinks.

aptitude install lynx-cur

or

aptitude install elinks
  • Now go with the text browser to the same address as specified before.

 elinks http://localhost:631/
  • Follow the instructions you see on the screen. Set the default printer.

[ATTACH]

Example, kyocera printer

  • Type in:

elinks http://localhost:631/
  • Click on Do Administration Task, then Add New Printer,

Name: kyocera9520
Location: Back Room
Description: High output printer
  • Click Continue

  • Click on !AppSocket/HP JetDirect

  • If you have a network printer that you can directly print to, select:

LPD/LPR Host Printer
  • Then change a device URI to one of the examples:

socket://hostname:9100
  • Then select Make.Then Model. If your model is not there, you can try picking similar printer number/driver and it should work.

  • When done go back to original menu. Click on Set Default Printer

  • Done. Anything below is optional

Printer Status

  • Is the printer running?

lpstat -r
  • What is the default printer?

lpstat -d 
  • Printer queue

lpq

You may not have a physical printer but need to get a document ready to print then you could to a PDF file.

First you'll need to install cups-pdf by running the following:

aptitude install cups-pdf

Once completed you need to setup the printer in Gnome as follows. Go to:

System--> Administration--> Printing

This will bring up a list of printers and in here you'll see an icon Add Printer

Now follow the steps as defined below:

Select "Local Printer" and use a "detected printer --> PDF printer".
Manufacturer --> Generic,
Model --> postscript color printer rev4,
Driver --> Standard
Apply

Finally you'll get a PDF folder in your Home.

CUPS Administration

  • CUPS can also be administered via its web interface (http://localhost:631). You will be asked for the root user login and password.

  • Any other setting can be done through the easy web interface or using a print settings program as root:

http://localhost:631/
  • Options include: pause, resume, cancel print jobs, etc.
  • [Optional]You can also login to the web interface as any user in the "lpadmin" group

No Printer Drivers

Most of the more common printer should already have drivers in cups system. For the newer or more commercial ones see the manufacture website. You should look for the PPD file of your printer model. The PPD file describes the capabilities of the printer. For a comprehensive review and database of printer models, drivers and PPD files see http://www.linuxprinting.org

Brother

Canon

HP

Install hplip package. For new printers, it may be necessary to download and install hplip directly from the project web site. Check your printer here: HPLIP supported printers. This page will show the version of hplip required by your model. Setup the printer by running hp-setup (see below).

Kyoceramita (PPD)

Samsung

Alternative Automatic Configuration

system-config-printer (formally 'printconf')

system-config-printer is a printer administration tool which first appeared in Fedora and later in Debian and Ubuntu. The purpose of the tool is to configure a CUPS server (often the local machine) using the CUPS API. The tool is written in Python, using pygtk for the graphical parts and with some Python bindings (pycups) for the CUPS API.

It is largely the same as using the CUPS web interface for configuring printers, but has the advantage of being a native application rather than a web page.

HP printer setup with 'hp-setup'

hp-setup is included with HP Linux Imaging & Printing project package hplip and performs setup of USB, parallel, and network printers and All-in-Ones. Network printers are automatically detected via mDNS (aka Bonjour on Macs). Using hp-setup to install printer also enables hp utilities for checking ink/toner level and printer maintenance. Run 'hp-check -r' to troubleshoot printing or scanning issues.

HP LaserJet 10xx printer setup with 'printer-driver-foo2zjs'

Install CUPS, driver and non-free firmware downloader:

  $ sudo apt-get install cups printer-driver-foo2zjs hannah-foo2zjs

Download non-free firmware with gui:

  $ sudo hannah-foo2zjs

Re-plug USB connection to printer in order to execute /lib/udev/rules.d/85-hplj10xx.rules which download firmware to printer.

Visit http://localhost:631/admin and push to "Add new printer" button. Your model will be present. Check it and push "Next". Find .pdd setting by selecting HP and your printer model next with Foomatic/foo2zjs-z1 variation. Set default preference (like paper size). Print test page!

Printer Sharing

CUPS as Print Server for Windows Machines

You can setup CUPS to allow Windows machines to print to a CUPS server using an http address.

First, install the samba package. When you are asked to use WINS, say yes.

$ aptitude install samba

Next setup your /etc/cups/cupsd.conf file.

# Our private connection we listen to
Listen *:49631

# Allow machines on local network to use printers
<Location /printers>
  Order allow,deny
  Allow 192.168.0.*
  Allow 192.168.1.*
</Location>

This will listen on port 49631 from any network. You may use some other port number besides 631. Note that the dynamic and/or private ports as specified by the IANA are in the range 49152 through 65535. Also, this will only allow computers from the local network to print to the CUPS printers.

Next, restart the CUPS daemon

$ /etc/init.d/cups restart

Now on each Windows machine, Choose that you want to install a network printer and that you want to install a printer on the Internet or home/office network. The URL you will use should be:

http://<cups_server_hostname>:49631/printers/<printer_name>

Lastly, the driver to install is in the Generic section labeled MS Publisher Color Printer.

CUPS and Samba

This section needs updating as you can setup print server via samba print sharing just by uploading drivers.

When printing to windows printers in an NT domain using SMB the Device URI should read

  smb://username:password@domain/server/printername

This allows Samba to authenticate against a domain controller for acces to the printer queue.

You may also omit the username:password@ part when the server does not need authentification. As the hostname both, a windows computer name or an IP address would work. To determine the printername you may use the smbclient command line tool. Run the following command, where computername refers to the name of the machine that shares the printer:

  smbclient -L computername

Check the ouput for entries with Type "Printer":

$ smbclient -L base

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Druckertreiber
        HPOffice        Printer   HP Officejet J4500 Series
        ADMIN$          Disk      Remoteadmin
        C$              Disk      Standardfreigabe

The resulting URL from the output above would be

  smb://base/HPOffice

When printing to a Debian CUPS printer from a machine that connects through Samba, you may need to set up a CUPS class to get things to work.

Printer sharing using Macintosh as the client and Debian as the server

You have a printer on a debian machine and you want to share it with a Macintosh, so that the Mac can print to the Debian-based printer. Try this:

1. Use cups to set up the printer on Debian as described above. The Gnome tool for printer configuration works well, and the 100% bullet-proof way is to use the browser-based CUPS configuration.

2. On the Mac (OS X 10.4+) start Print and Fax from System Preferences. Use the + button to add a printer.

3. Look first in the "Default" tab. If the automagic printer-sharing has worked, and your Mac is connected to the local network properly, then the Debian-based printer should already be visible in the list. Just select it and use the recommended print driver. Your results may vary but you can't go to far wrong if you pick a driver that matches the one you are using on Debian. So, for example, you might like to try using Gutenprint drivers at both ends.

4. If your printer is not visible in the Default tab, then try adding it on the "IP" tab. Pick IPP as the protocol, give the plain IP address of the server in the address box, and in the Queue box put "printers/<debian-queue-name>". Put whatever helps you identify the printer in the Name and Location boxes, and choose a printer driver than matches what you used to set up the printer on Debian. Finally cross your fingers, hold your breath, recite a prayer/spell/incantation, and press the Add button.

As they say: your mileage may vary.

Printing Pictures

Professional looking photos may be obtained when using high quality glossy photo paper on an inkjet printer but care must be taken when submitting the print job. Printing from The Gimp image manipulation program produces very good results. The print dialog will vary depending upon the printer used. The most important settings are type of paper, glossy photo or whatever sort you are using, and image type, "photograph". The size of the printed image is adjusted in the printer dialog as well.

Other printing Systems

Debian has several alternatives available for printing:

  • CUPS. (Instructions above.) The newer Common UNIX Printing System (or CUPS) is a printing system and general replacement for lpd and the like. It supports the Internet Printing Protocol (IPP), and has its own filtering driver model for handling various document types.

  • LPR. The still commonly used traditional printing system is called lpr which works quite well if you have a postscript printer. Otherwise, it is not very simple to set up and doesn't provide much control for users on the printer settings per print job.

  • RLPR Remote line printer spooling system.

  • xpp is designed to be able to take the same command-line arguments as BSD-lpr and SysV-lp so most apps won't realize the difference if you create a symbolic link from /usr/bin/lpr (or /usr/bin/lp) to /usr/bin/xpp. This way, whenever an application sends off a print job to the lpr (or lp) program, xpp will launch its GUI so that you can select the options that you would like for this job.

These alternatives are maintained by different groups. But there is a lot of collaboration and coordination between them, which occurs on the debian-printing list.

External links

See also