linux下打印机是文件吗,linux下打印机的配置和使用

1、打印机的组成:

打印机有自己的CPU、内存、操作系统甚至硬盘,如果是一台网络打印机的话,那么它还应该运行着自己的web服务器,用户可以访问其网站进行配置和管理。

2打印机的语言:

打印机使用页面描述语言(Page Description Language,PDL)对要进行打印的页面进行描述。

经过PDL编码的页面可以提供比原始图像更小的数据量、更大的传输速度。而且,PDL可以实现与设备和分辨率无关的页面描述。

主流的PDL:PostScript、PCL5、PCL6、PDF。

PostScript是linux上最常见的PDL,几乎所有的页面布局程序都可以生成PostScript。

3、打印机的工作过程:

当用户在应用软件中按下“打印”按钮时,就给打印机发送了一个打印作业。打印机接收到用PDL描述的作业后,会调用自己的光栅图像处理器把这个文件转换成位图形式,这个过程叫做“光栅图像处理”。打印机接收到这个位图之后就可以进行打印了。一些打印机可以理解几乎所有的主流PDL,另一些则什么都理解不了。后一种打印机称为GDI打印机,它们需要依赖计算机做光栅处理,然后接收现成的位图图像。

4、打印机驱动:

打印机的驱动程序并不能算真正意义上的“驱动程序”,因为它和硬件驱动没有太大的关系。把文件转化为打印机所能理解的PDL,这是打印机驱动程序所要做的全部事情。

5、CUPS:

CUPS是公共UNIX打印系统(Comon UNIX Printing System)的缩写形式。

CUPS基于服务器/客户机架构。

CUPS使用HTTP协议来管理打印任务,通过使用浏览器访问主机的631端口可以打开这个管理界面。在地址栏中输入http://localhost:631,并按下Enter键。

6、打印机的选择:

在选择一款打印机前,应该首先去了解一下这款产品可以在linux下得到多大程度的支持。最直接的方法是访问www.linuxprinting.org的Foomatic数据库,这个数据库将打印分成从Paperweight到Perfectly的4个等级。毫无疑问,Pefectly类的打印机可以在linux下获得最好的支持,用户应该尽可能地选择这一类。

7、CUPS是如何识别打印机的?

当用户给CUPS布置打印任务的时候,CUPS理应知道当前连接的打印机所使用的PDL及打印机所能提供的各项功能。所有的这些信息都包含在打印机的PPD文件中。PPD代表PostScript Printer Description,即PostScript打印机描述。这个文件记录了打印机的各项参数和功能、CUPS过滤器,以及其他平台上的打印机驱动程序,据此判断如何把打印作业发送给PostScript打印机。如今,每一台PostScript打印机都提供有特定的PDD文件,这通常可以在安装光盘找到。

对于CUPS而言,非PostScript打印机同样可以使用PDD文件来描述。只要找到某台打印机的PDD文件,CUPS就能够驱动它,至少从理论上讲是这样。

8、如何寻找特定打印机的PDD文件?

linuxprinting.org提供了大量这样的PDD文件。用户要做的只是把打印机对应的PDD文件下载下来,然后复制到CUPS的目录中去。通常,这个目录是/usr/share/cups/model(Ubuntu是/usr/share/ppd)。

有时候找到的PPD文件可能是某一类打印机的通用PPD文件,因此并不能发挥打印机的全部功能。但至少要比没有的强。

9、配置打印机:

lpoptions -d N7400 #将N7400设置为当前用户的默认打印机。

lpr example.pdf #将example.pdf文件打印。

只要简单地给lpr命令传递一个文件名作为参数,CUPS会使用默认打印机打印这个文件。如果连接了多台打印机,那么可以使用-P选项指定使用哪一台打印机打印文档。例如,下面的这条命令明确指定使用N7400打印文件example.pdf。

lpr -P N7400 example.pdf

10、CUPS的配置文件:

CUPS的配置文件叫做cupsd.conf,通常保存在/etc/cups目录下。这是一个文本文件,可以使用more或者less命令查看其内容。

less /etc/cups/cupsd.conf

这个文件中,Listen localhost:631表示CUPS在631端口提供服务。

CUPS可以向网络上的其他主机提供服务,要让CUPS接受来自其他主机的打印作业,应该在cupsd.conf中找到下面的这几行:

Order allow,deny

把他们替换为下面这种形式。其中,netaddress应该替换为网络的IP地址。

Order allow,deny

Deny from all

Allow from 127.0.0.1

Allow from netaddress

这几行的含义:Deny from all表示CUPS不接受任何主机的打印请求。但紧跟着的两行定义了两种例外:Allow from 127.0.0.1和Allow from netaddress允许来自本机(127.0.0.1)和netaddress的计算机使用打印服务。

为了让网络上的主机可以看到CUPS服务器正在提供的打印服务,那么还应该找到下面这一行:

BrowseAddress @LOCAL

将其修改成:

BrowseAddress broadcastAddress:631

其中,broadcastAddress应该替换为网络的广播地址(如10.71.84.255)。全0和全1的主机地址呗保留作为网络地址和广播地址。

保存配置文件后,重新启动CUPS服务器使修改生效:

sudo /etc/init.d/cups restart

11、设置打印机的类:

添加打印机的类,可以用lpadmin命令,下面的两条命令创建打印机的类office,并把打印机N7400和zoe加入这个类。

lpadmin -p N7400 -c office

lpadmin -p zoe -c office

从类中删除一台打印机,使用-r选项:

lpadmin -p zoe -r office

删除类和打印机使用-x选项:

lpadmin -x zoe #删除打印机zoe

lpadmin -x office #删除打印机类office

12、打印机队列:

lpq可以从CUPS服务器那里查询到当前打印作业的状态信息。

lpq中的第3列为报告的作业号。要删除一个打印作业,可以使用lprm命令提供作业号作为参数。

例如:lprm 5 #删除作业号为5的打印作业。

13、打印机的状态:

可以使用lpstat -t命令显示当前CUPS的状态信息。

资源分为10份,此为第10份文件,包含以下打印机PPD文件: hp-photosmart_b8500_series hp-photosmart_c309a_series hp-photosmart_c3100_series hp-photosmart_c4100_series hp-photosmart_c4200_series hp-photosmart_c4340_series hp-photosmart_c4380_series hp-photosmart_c4400_series hp-photosmart_c4500_series hp-photosmart_c4600_series hp-photosmart_c4700_series hp-photosmart_c5100_series hp-photosmart_c5200_series hp-photosmart_c5300_series hp-photosmart_c5500_series hp-photosmart_c6100_series hp-photosmart_c6200_series hp-photosmart_c6300_series hp-photosmart_c7100_series hp-photosmart_c7200_series hp-photosmart_c8100_series hp-photosmart_d110_series hp-photosmart_d5060_series hp-photosmart_d5100_series hp-photosmart_d5300_series hp-photosmart_d5400_series hp-photosmart_d6100_series hp-photosmart_d7100_series hp-photosmart_d7200_series hp-photosmart_d7300_series hp-photosmart_d7400_series hp-photosmart_d7500_series hp-photosmart_estn_c510_series hp-photosmart_ink_adv_k510 hp-photosmart_p1000 hp-photosmart_p1100 hp-photosmart_plus_b209a-m hp-photosmart_plus_b210_series hp-photosmart_prem-web_c309n-s hp-photosmart_prem_c310_series hp-photosmart_prem_c410_series hp-photosmart_premium_c309g-m hp-photosmart_pro_b8300_series hp-photosmart_pro_b8800_series hp-photosmart_wireless_b109n-z hp-printer_scanner_copier_300 hp-psc_1000_series hp-psc_1100_series hp-psc_1200_series hp-psc_1300_series hp-psc_1310_series hp-psc_1358_series hp-psc_1400_series hp-psc_1500_series hp-psc_1600_series hp-psc_2100_series hp-psc_2150_series hp-psc_2170_series hp-psc_2200_series hp-psc_2210_series hp-psc_2300_series hp-psc_2350_series hp-psc_2400_series hp-psc_2500_series hp-psc_500 hp-psc_720 hp-psc_750 hp-psc_750xi hp-psc_760 hp-psc_780 hp-psc_780xi hp-psc_900_series hp-psc_920 hp-psc_950 hp-psc_950vr hp-psc_950xi hp-smart_tank_350_series hp-smart_tank_500_series hp-smart_tank_510_series hp-smart_tank_530_series hp-smart_tank_610_series hp-smart_tank_plus_550_series hp-smart_tank_plus_570_series hp-smart_tank_plus_650_series hp-smart_tank_wireless_450_series hp-tango
资源分为10份,此为第1份文件,包含以下打印机PPD文件: apollo-2100 apollo-2150 apollo-2200 apollo-2500 apollo-2600 apollo-2650 apollo-p2000-u apollo-p2250 hp-2000c hp-2500c hp-910 hp-915 hp-amp hp-business_inkjet_1000 hp-business_inkjet_1100 hp-business_inkjet_1200 hp-business_inkjet_2200 hp-business_inkjet_2230 hp-business_inkjet_2250-pcl3 hp-business_inkjet_2280-pcl3 hp-business_inkjet_2300-pcl3 hp-business_inkjet_2600-pcl3 hp-business_inkjet_2800-pcl3 hp-business_inkjet_3000-pcl3 hp-color_inkjet_printer_cp1700 hp-color_laserjet_1600 hp-color_laserjet_2500_series hp-color_laserjet_2600n hp-color_laserjet_3000-pcl3 hp-color_laserjet_3500 hp-color_laserjet_3500n hp-color_laserjet_3550 hp-color_laserjet_3550n hp-color_laserjet_3600 hp-color_laserjet_3700-pcl3 hp-color_laserjet_3700n hp-color_laserjet_3800-pcl3 hp-color_laserjet_4500-pcl3 hp-color_laserjet_4550-pcl3 hp-color_laserjet_4600-pcl3 hp-color_laserjet_4610-pcl3 hp-color_laserjet_4650-pcl3 hp-color_laserjet_4700-pcl3 hp-color_laserjet_4730mfp-pcl3 hp-color_laserjet_5 hp-color_laserjet_5500-pcl3 hp-color_laserjet_5550-pcl3 hp-color_laserjet_5m-pcl3 hp-color_laserjet_8500-pcl3 hp-color_laserjet_8550-pcl3 hp-color_laserjet_9500-pcl3 hp-color_laserjet_cm1312_mfp-pcl3 hp-color_laserjet_cm1312nfi_mfp-pcl3 hp-color_laserjet_cm2320_mfp-pcl3 hp-color_laserjet_cm2320fxi_mfp-pcl3 hp-color_laserjet_cm2320n_mfp-pcl3 hp-color_laserjet_cm2320nf_mfp-pcl3 hp-color_laserjet_cm3530_mfp-pcl3 hp-color_laserjet_cm4540_mfp-pcl3 hp-color_laserjet_cm4730_mfp-pcl3 hp-color_laserjet_cm6030_mfp-pcl3 hp-color_laserjet_cm6040_mfp hp-color_laserjet_cm6049_mfp hp-color_laserjet_cp1215 hp-color_laserjet_cp1217 hp-color_laserjet_cp1514n-pcl3 hp-color_laserjet_cp1515n-pcl3 hp-color_laserjet_cp1518ni-pcl3 hp-color_laserjet_cp2025-pcl3 hp-color_laserjet_cp2025dn-pcl3 hp-color_laserjet_cp2025n-pcl3 hp-color_laserjet_cp2025x-pcl3 hp-color_laserjet_cp3505-pcl3 hp-color_laserjet_cp3525-pcl3 hp-color_laserjet_cp4005-pcl3 hp-color_laserjet_cp4020_series-pcl3 hp-color_laserjet_cp4520_series-pcl3 hp-color_laserjet_cp5225-pcl3 hp-color_laserjet_cp5225dn-pcl3 hp-color_laserjet_cp5225n-pcl3
资源分为10份,此为第9份文件,包含以下打印机PPD文件: hp-officejet hp-officejet_r80xi hp-officejet_series_300 hp-officejet_series_310 hp-officejet_series_320 hp-officejet_series_330 hp-officejet_series_350 hp-officejet_series_520 hp-officejet_series_570 hp-officejet_series_580 hp-officejet_series_590 hp-officejet_series_600 hp-officejet_series_610 hp-officejet_series_630 hp-officejet_series_700 hp-officejet_series_710 hp-officejet_series_720 hp-officejet_series_725 hp-officejet_t_series hp-officejet_v30 hp-officejet_v40 hp-officejet_v40xi hp-officejet_v45 hp-photosmart_100 hp-photosmart_1115 hp-photosmart_1215 hp-photosmart_1218 hp-photosmart_130 hp-photosmart_1315 hp-photosmart_140_series hp-photosmart_230 hp-photosmart_240_series hp-photosmart_2570_series hp-photosmart_2600_series hp-photosmart_2700_series hp-photosmart_3100_series hp-photosmart_3200_series hp-photosmart_320_series hp-photosmart_3300_series hp-photosmart_330_series hp-photosmart_370_series hp-photosmart_380_series hp-photosmart_420_series hp-photosmart_470_series hp-photosmart_5510_series hp-photosmart_5510d_series hp-photosmart_5520_series hp-photosmart_6510_series hp-photosmart_6520_series hp-photosmart_7200_series hp-photosmart_7345 hp-photosmart_7400_series hp-photosmart_7510_series hp-photosmart_7520_series hp-photosmart_7550 hp-photosmart_7600_series hp-photosmart_7700_series hp-photosmart_7800_series hp-photosmart_7900_series hp-photosmart_8000_series hp-photosmart_8100_series hp-photosmart_8200_series hp-photosmart_8400_series hp-photosmart_8700_series hp-photosmart_a310_series hp-photosmart_a320_series hp-photosmart_a430_series hp-photosmart_a440_series hp-photosmart_a510_series hp-photosmart_a520_series hp-photosmart_a530_series hp-photosmart_a610_series hp-photosmart_a620_series hp-photosmart_a630_series hp-photosmart_a640_series hp-photosmart_a710_series hp-photosmart_a820_series hp-photosmart_b010_series hp-photosmart_b109a_series hp-photosmart_b110_series
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值