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


Debian 打印 (CUPS)

关键词:Linux Printing, Debian, cups system, HP Linux and Image software, Install, Add , Change Printers, Print Server, Linux 打印, HP Linux 和图像软件, 安装, 添加, 更改打印机, 打印服务器,

通用 UNIX 打印系统(英文 The Common UNIX Printing System,缩写 CUPS)是一个打印系统,通常是 lpd 和其他旧打印系统的替代者。CUPS Debian 包简单易用、功能强大,让打印在 Debian 上更加方便。(http://www.cups.org/)

安装

aptitude update
aptitude install cups cups-client

/etc/init.d/cups start

提示:上述命令需要管理员权限,在执行上述命令时可在前面添加 sudo 来执行。

添加打印机

http://localhost:631/

下面我们就可以通过 CUPS 的管理界面(“Administration”标签页下)来添加打印机了。如果您遇到权限错误,可尝试下面命令将您的帐号添加到 lpadmin 用户组。比如,您的用户名为“tom”,则:

sudo usermod -a -G lpadmin tom

aptitude install lynx-cur

aptitude install elinks

 elinks http://localhost:631/

HomeCups.png

添加 kyocera 打印机

elinks http://localhost:631/

Name: kyocera9520
Location: Back Room
Description: High output printer

LPD/LPR Host Printer

socket://hostname:9100

打印机状态

lpstat -r

lpstat -d 

lpq

打印到 PDF

您可能没有物理打印机(穷啊),但要打印的文档已准备就绪,则可以选择打印一份 PDF 文件。

首先,需要安装 cups-pdf:

aptitude install cups-pdf

安装完成,在 Gnome 中可按下下面步骤设置打印机:

系统设置--> 硬件--> 打印机

在此处您会看到一个打印机列表,和一个“添加新打印机”按钮。

现在按照下面步骤一步一步来吧:

选择“本地打印机”,“已探测到的打印机” --> “PDF 打印机“。
Manufacturer --> Generic,
Model --> postscript color printer rev4,
Driver --> Standard
Apply

最终,你会在你的Home文件夹中发现一个PDF文件夹。

CUPS 管理

http://localhost:631/

无打印机驱动

Most of the more common printer should already have drivers in cups system. For the newer or more commercial once 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 (PPD)

For copier/printer/scanner like Imagerunner 5065

  1. Download the PPD drivers: http://downloads.canon.com/cpr/software/imagerunner/PPD_v241.exe

  2. 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: 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)

Above Information merged from Lucasmanual.com Printing Section

可选的自动化配置

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.

它在很大程度上和使用CUPS打印机网页配置界面是相同的,但是它有一个优势是:它是本地应用程序而不是网页。

用'hp-setup'配置HP打印机

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.

打印机共享

CUPS作为其他Windows机器的打印服务器

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 和 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.

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.

打印图片

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.

其他打印系统

在 Debian 下可以使用下面几种可用的打印系统:

这些打印系统由不同的小组来维护,但他们之间也有很多合作与协调,可查看列表 debian-printing

外部链接

参见