linux cups 总结 ps转tiff.docx
- 文档编号:29616817
- 上传时间:2023-07-25
- 格式:DOCX
- 页数:23
- 大小:21.90KB
linux cups 总结 ps转tiff.docx
《linux cups 总结 ps转tiff.docx》由会员分享,可在线阅读,更多相关《linux cups 总结 ps转tiff.docx(23页珍藏版)》请在冰豆网上搜索。
linuxcups总结ps转tiff
最近这段时间从Android转入了c++服务端开发,接了一个任务,在centos6.5下把pdf、文本文件、图片等转换为tiff格式(传真需要的格式),因此研究了一番linux下cups打印原理与系统,现在基本摸清,可以把任意pdf和图片转换为tiff,linux下utf8的文本文档如果有中文,则中文会叠在一起,windows下gbk的中文无法打印,有知道的兄弟告诉我一下。
流程:
pdf、图片、文本----------------------------------->PostScript---------------------------------->tiff
以上流程利用了标准linux打印的基本流程。
配置文件:
/etc/cups/cupsd.conf :
cups服务配置文件
[plain] viewplaincopy
1.MaxLogSize 0
2.#
3.# "$Id:
cupsd.conf.in 8805 2009-08-31 16:
34:
06Z mike $"
4.#
5.# Sample configuration file for the CUPS scheduler. See "man cupsd.conf" for a
6.# complete description of this file.
7.#
8.
9.# Log general information in error_log - change "warn" to "debug"
10.# for troubleshooting...
11.LogLevel warn
12.
13.# Administrator user group...
14.SystemGroup sys root
15.
16.# Only listen for connections from the local machine.
17.Listen localhost:
631
18.Listen /var/run/cups/cups.sock
19.
20.# Show shared printers on the local network.
21.Browsing On
22.BrowseOrder allow,deny
23.BrowseAllow all
24.BrowseLocalProtocols CUPS dnssd
25.
26.# Default authentication type, when authentication is required...
27.DefaultAuthType Basic
28.
29.# Restrict access to the server...
30.
31. Order allow,deny
32.
33.
34.# Restrict access to the admin pages...
35.
36. Order allow,deny
37.
38.
39.# Restrict access to configuration files...
40.
41. AuthType Default
42. Require user @SYSTEM
43. Order allow,deny
44.
45.
46.# Set the default printer/job policies...
47.
48. # Job-related operations must be done by the owner or an administrator...
49.
50. Require user @OWNER @SYSTEM
51. Order deny,allow
52.
53.
54. # All administration operations require an administrator to authenticate...
55.
56. AuthType Default
57. Require user @SYSTEM
58. Order deny,allow
59.
60.
61. # All printer operations require a printer operator to authenticate...
62.
63. AuthType Default
64. Require user @SYSTEM
65. Order deny,allow
66.
67.
68. # Only the owner or an administrator can cancel or authenticate a job...
69.
70. Require user @OWNER @SYSTEM
71. Order deny,allow
72.
73.
74.
75. Order deny,allow
76.
77.
78.
79.# Set the authenticated printer/job policies...
80.
81. # Job-related operations must be done by the owner or an administrator...
82.
83. AuthType Default
84. Order deny,allow
85.
86.
87.
88. AuthType Default
89. Require user @OWNER @SYSTEM
90. Order deny,allow
91.
92.
93. # All administration operations require an administrator to authenticate...
94.
95. AuthType Default
96. Require user @SYSTEM
97. Order deny,allow
98.
99.
100. # All printer operations require a printer operator to authenticate...
101.
102. AuthType Default
103. Require user @SYSTEM
104. Order deny,allow
105.
106.
107. # Only the owner or an administrator can cancel or authenticate a job...
108.
109. AuthType Default
110. Require user @OWNER @SYSTEM
111. Order deny,allow
112.
113.
114.
115. Order deny,allow
116.
117.
118.
119.#
120.# End of "$Id:
cupsd.conf.in 8805 2009-08-31 16:
34:
06Z mike $".
121.#
/etc/cups/printers.conf:
具体打印机的配置文件,其中的MDSFaxServer是我自己创建的虚拟打印机,其中加粗的地方需要注意
Filter用来指出对于相应的MIMEtype,该找到哪个filter转换它。
(filter是cups的重要组件,完成各种格式的转换)
DeviceURI用来指出/usr/lib/cups/backend下的下一步处理的程序,这里指向下面的/usr/lib/cups/backend/mdsfaxserver脚本
[plain] viewplaincopy
1.
2.Info MDS Fax Server
3.MakeModel Generic PostScript Printer Foomatic/Postscript (recommended)
4.DeviceURI mdsfaxserver:
/
5.State Idle
6.StateTime 1418957192
7.Type 8433692
8.Filter application/vnd.cups-raw 0 -
9.Filter application/vnd.cups-postscript 100 foomatic-rip
10.Filter application/vnd.cups-pdf 0 foomatic-rip
11.Accepting Yes
12.Shared No
13.JobSheets none none
14.QuotaPeriod 0
15.PageLimit 0
16.KLimit 0
17.OpPolicy default
18.ErrorPolicy retry-job
19.
/etc/cups/ppd/MDSFaxServer.ppd
ppd文件的作用相当于打印机驱动程序,指定了打印时的具体参数,例如页面参数,用什么filter转换。
打印机的ppd文件或者具体驱动可以到http:
//www.linuxfoundation.org/ 下载
[plain] viewplaincopy
1.*PPD-Adobe:
"4.3"
2.*%
3.*% For information on using this, and to obtain the required backend
4.*% script, consult http:
//www.openprinting.org/
5.*%
6.*% This file is published under the GNU General Public License
7.*%
8.*% PPD-O-MATIC (4.0.0 or newer) generated this PPD file. It is for use with
9.*% all programs and environments which use PPD files for dealing with
10.*% printer capability information. The printer must be configured with the
11.*% "foomatic-rip" backend filter script of Foomatic 4.0.0 or newer. This
12.*% file and "foomatic-rip" work together to support PPD-controlled printer
13.*% driver option access with all supported printer drivers and printing
14.*% spoolers.
15.*%
16.*% To save this file on your disk, wait until the download has completed
17.*% (the animation of the browser logo must stop) and then use the
18.*% "Save as..." command in the "File" menu of your browser or in the
19.*% pop-up manu when you click on this document with the right mouse button.
20.*% DO NOT cut and paste this file into an editor with your mouse. This can
21.*% introduce additional line breaks which lead to unexpected results.
22.*%
23.*% You may save this file as 'Generic-PostScript_Printer-Postscript.ppd'
24.*%
25.*%
26.*FormatVersion:
"4.3"
27.*FileVersion:
"1.1"
28.*LanguageEncoding:
English
29.*LanguageVersion:
ISOLatin1
30.*PCFileName:
"POSTSCRI.PPD"
31.*Manufacturer:
"Generic"
32.*Product:
"(PostScript Printer)"
33.*cupsVersion:
1.0
34.*cupsManualCopies:
True
35.*cupsModelNumber:
2
36.*cupsFilter:
"application/vnd.cups-postscript 100 foomatic-rip"
37.*cupsFilter:
"application/vnd.cups-pdf 0 foomatic-rip"
38.*%pprRIP:
foomatic-rip other
39.*ModelName:
"Generic PostScript Printer"
40.*ShortNickName:
"Generic P.S. Printer Postscript"
41.*NickName:
"Generic PostScript Printer Foomatic/Postscript (recommended)"
42.*PSVersion:
"(3010.000) 550"
43.*PSVersion:
"(3010.000) 651"
44.*PSVersion:
"(3010.000) 652"
45.*PSVersion:
"(3010.000) 653"
46.*PSVersion:
"(3010.000) 704"
47.*PSVersion:
"(3010.000) 705"
48.*PSVersion:
"(3010.000) 800"
49.*PSVersion:
"(3010.000) 815"
50.*PSVersion:
"(3010.000) 850"
51.*PSVersion:
"(3010.000) 860"
52.*PSVersion:
"(3010.000) 861"
53.*PSVersion:
"(3010.000) 862"
54.*PSVersion:
"(3010.000) 863"
55.*PSVersion:
"(3010.000) 864"
56.*PSVersion:
"(3010.000) 870"
57.*LanguageLevel:
"3"
58.*ColorDevice:
True
59.*DefaultColorSpace:
RGB
60.*FileSystem:
False
61.*Throughput:
"1"
62.*LandscapeOrientation:
Plus90
63.*TTRasterizer:
Type42
64.*1284DeviceID:
"DRV:
DPostscript,R1,M0,F1,P0,TP;"
65.
66.*driverName Postscript:
""
67.*driverType P/PostScript:
""
68.*driverUrl:
"
69.*driverObsolete:
False
70.*driverManufacturerSupplied:
False
71.*driverFreeSoftware:
True
72.
73.
74.
75.
76.*HWMargins:
18 36 18 36
77.*VariablePaperSize:
True
78.*MaxMediaWidth:
100000
79.*MaxMediaHeight:
100000
80.*NonUIOrderDependency:
100 AnySetup *CustomPageSize
81.*CustomPageSize True:
"pop pop pop
82.<>setpagedevice"
83.*End
84.*ParamCustomPageSize Width:
1 points 36 100000
85.*ParamCustomPageSize Height:
2 points 36 100000
86.*ParamCustomPageSize Orientation:
3 int 0 0
87.*Par
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- linux cups 总结 ps转tiff ps tiff