slitaz-doc-wiki-data view pages/en/guides/printer.txt @ rev 7

Add pages/en folder.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Feb 26 12:17:18 2011 +0000 (2011-02-26)
parents
children
line source
1 ====== Printing ======
3 The CUPS (Common Unix Printing System) software manages printers connected to the local computer or over a network. The local printers are attached via a loop-back connection (IP 127.0.0.1), a network connection pointing to the same system.
5 ===== Installing a Network Printer =====
7 Install CUPS and add the user(s) to the //lp// group to gain permissions to access the devices. This can be done as root in a terminal:
9 <code>
10 # tazpkg get-install cups
11 # addgroup tux lp
12 </code>
14 Again as root, customise the default configuration in /etc/cupsd.conf:
16 <file>
17 # Administrator user group...
18 SystemGroup lp
20 # Restrict access to the admin pages...
22 Order allow,deny
23 Allow 127.0.0.1
26 # Restrict access to configuration files...
28 AuthType Default
29 Require user @SYSTEM
30 Order allow,deny
31 Deny From None
32 Allow From 127.0.0.1
33 </file>
35 Set the administrative password for CUPS and add an administrative user:
37 <code>
38 # lppasswd -g lp -a tux
39 </code>
41 You should now be able to have access to the CUPS administration through your browser by entering the address ''<nowiki>http://localhost:631/</nowiki>''
43 Install the printer drivers with the following packages:
45 - hplip : for HP printers
46 - gutenprint : for Canon, Epson, Lexmark, Sony, Olympus
47 - foomatic-db, foomatic-db-engine, foomatic-db-nonfree and foomatic-filters : several free software printer drivers
48 - ufr2: for Canon printers (extra drivers)
49 - splix: for Samsung
50 - cups-pdf: for "printing" to PDF files
52 For example, install the HP printer drivers with the following //root// command
53 <code>
54 # tazpkg get-install hplip
55 </code>
57 Now you add a new printer in the browser interface and choose:
59 <nowiki>LPD/LPR Host or Printer (Unknown),
60 and add the address socket//192.168.2.1:9100</nowiki>
62 If you get the error, "//Returning IPP client-error-document-format-not-supported for Print-Job in /var/log/cups/error.log//" then add two files to the /etc/cups directory. The easiest method is to start a text editor such as Leafpad from a root terminal; start the Terminal and switch to the root user.
64 * ''mime.convs'' (/etc/cups/mime.convs):
65 <file>
66 application/pdf application/postscript 33 pdftops
67 application/postscript application/vnd.cups-postscript 66 pstops
68 application/vnd.hp-HPGL application/postscript 66 hpgltops
69 application/x-cshell application/postscript 33 texttops
70 application/x-csource application/postscript 33 texttops
71 application/x-perl application/postscript 33 texttops
72 application/x-shell application/postscript 33 texttops
73 text/plain application/postscript 33 texttops
74 text/html application/postscript 33 texttops
75 image/gif application/vnd.cups-postscript 66 imagetops
76 image/png application/vnd.cups-postscript 66 imagetops
77 image/jpeg application/vnd.cups-postscript 66 imagetops
78 image/tiff application/vnd.cups-postscript 66 imagetops
79 image/x-bitmap application/vnd.cups-postscript 66 imagetops
80 image/x-photocd application/vnd.cups-postscript 66 imagetops
81 image/x-portable-anymap application/vnd.cups-postscript 66 imagetops
82 image/x-portable-bitmap application/vnd.cups-postscript 66 imagetops
83 image/x-portable-graymap application/vnd.cups-postscript 66 imagetops
84 image/x-portable-pixmap application/vnd.cups-postscript 66 imagetops
85 image/x-sgi-rgb application/vnd.cups-postscript 66 imagetops
86 image/x-xbitmap application/vnd.cups-postscript 66 imagetops
87 image/x-xpixmap application/vnd.cups-postscript 66 imagetops
88 image/x-sun-raster application/vnd.cups-postscript 66 imagetops
91 image/gif application/vnd.cups-raster 100 imagetoraster
92 image/png application/vnd.cups-raster 100 imagetoraster
93 image/jpeg application/vnd.cups-raster 100 imagetoraster
94 image/tiff application/vnd.cups-raster 100 imagetoraster
95 image/x-bitmap application/vnd.cups-raster 100 imagetoraster
96 image/x-photocd application/vnd.cups-raster 100 imagetoraster
97 image/x-portable-anymap application/vnd.cups-raster 100 imagetoraster
98 image/x-portable-bitmap application/vnd.cups-raster 100 imagetoraster
99 image/x-portable-graymap application/vnd.cups-raster 100 imagetoraster
100 image/x-portable-pixmap application/vnd.cups-raster 100 imagetoraster
101 image/x-sgi-rgb application/vnd.cups-raster 100 imagetoraster
102 image/x-xbitmap application/vnd.cups-raster 100 imagetoraster
103 image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
104 image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
106 application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
107 </file>
109 * ''mime.types'' (/etc/cups/mime.types):
111 <file>
112 application/pdf pdf string(0,%PDF)
113 application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
114 contains(0,128,<1B>%-12345X) + \
115 (contains(0,4096,"LANGUAGE=POSTSCRIPT") \
116 contains(0,4096,"LANGUAGE = Postscript") \
117 contains(0,4096,"LANGUAGE = PostScript") \
118 contains(0,4096,"LANGUAGE = POSTSCRIPT") \
119 (contains(0,4096,<0a>%!) + \
120 !contains(0,4096,"ENTER LANGUAGE")))
121 application/vnd.hp-HPGL hpgl \
122 string(0,<1B>E<1B>%0B) \
123 string(0,<1B>%-1B) string(0,<201B>)\
124 string(0,BP;) string(0,IN;) string(0,DF;) \
125 string(0,BPINPS;) \
126 (contains(0,128,<1B>%-12345X) + \
127 (contains(0,4096,"LANGUAGE=HPGL") \
128 contains(0,4096,"LANGUAGE = HPGL")))
130 ########################################################################
131 #
132 # Image files...
133 #
135 image/gif gif string(0,GIF87a) string(0,GIF89a)
136 image/png png string(0,<89>PNG)
137 image/jpeg jpeg jpg jpe string(0,) &&\
138 (char(3,0xe0) char(3,0xe1) char(3,0xe2) char(3,0xe3)\
139 char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\
140 char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\
141 char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef))
142 image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
143 image/x-photocd pcd string(2048,PCD_IPI)
144 image/x-portable-anymap pnm
145 image/x-portable-bitmap pbm string(0,P1) string(0,P4)
146 image/x-portable-graymap pgm string(0,P2) string(0,P5)
147 image/x-portable-pixmap ppm string(0,P3) string(0,P6)
148 image/x-sgi-rgb rgb sgi bw icon short(0,474)
149 image/x-xbitmap xbm
150 image/x-xpixmap xpm ascii(0,1024) + string(3,"XPM")
151 #image/x-xwindowdump xwd string(4,<00000007>)
152 image/x-sun-raster ras string(0,<59a66a95>)
154 #image/fpx fpx
155 image/x-alias pix short(8,8) short(8,24)
156 image/x-bitmap bmp string(0,BM) && !printable(2,14)
157 image/x-icon ico
159 ########################################################################
160 #
161 # Text files...
162 #
164 application/x-cshell csh printable(0,1024) + string(0,#!) +\
165 (contains(2,80,/csh) contains(2,80,/tcsh))
166 application/x-perl pl printable(0,1024) + string(0,#!) +\
167 contains(2,80,/perl)
168 application/x-shell sh printable(0,1024) + string(0,#!) +\
169 (contains(2,80,/bash) contains(2,80,/ksh)\
170 contains(2,80,/sh) contains(2,80,/zsh))
171 application/x-csource c cxx cpp cc C h hpp \
172 printable(0,1024) + \
173 (string(0,/*) string(0,//)
174 string(0,#include) contains(0,1024,<0a>#include) \
175 string(0,#define) contains(0,1024,<0a>#define))
176 text/html html htm printable(0,1024) +\
177 (istring(0,"") istring(0,"))
178 text/plain txt printable(0,1024)
179 text/css css
182 ########################################################################
183 #
184 # RSS feed type...
185 #
187 application/rss+xml rss
190 ########################################################################
191 #
192 # CUPS-specific types...
193 #
195 application/vnd.cups-command string(0,'#CUPS-COMMAND')
196 application/vnd.cups-form string(0,"")
197 application/vnd.cups-pdf
198 application/vnd.cups-postscript
199 application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
200 application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
201 application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
202 string(0,<1B>@) \
203 (contains(0,128,<1B>%-12345X) + \
204 (contains(0,4096,"LANGUAGE=PCL") \
205 contains(0,4096,"LANGUAGE = PCL")))
207 ########################################################################
208 #
209 # Raw print file support...
210 #
211 # Comment the following type to prevent raw file printing.
212 #
214 application/octet-stream
215 </file>
217 <note tip>If at the end of the procedures the printer is not working, restarting the service or computer may help.</note>
219 ===== Installing an USB Brother HL 2030 Printer =====
221 To install cups, hal-cups-utils, usbutils. As root, type:
223 <code>
224 root@slitaz:# tazpkg get-install cups
225 root@slitaz:# tazpkg get-install hal-cups-utils
226 root@slitaz:# tazpkg get-install usbutils
227 </code>
229 Cups is used to manage the printer, hal-cups-utils allows cups to use HAL for printer connections and usbutils gives us the lsusb utility which lets us know how the printer is connected.
231 Now we can add tux to the lp (printer) group. As root, we do:
233 <code>
234 root@slitaz:# addgroup tux lp
235 </code>
237 For the web interface of cups to be properly activated, we still need to change a few things in the ///etc/cupsd.conf// file:
239 <code>
240 root@slitaz:# leafpad /etc/cups/cupsd.conf
241 </code>
243 <file>
244 # Administrator user group...
245 SystemGroup lp
247 # Restrict access to the admin pages...
249 Order allow,deny
250 Allow 127.0.0.1
253 # Restrict access to configuration files...
255 AuthType Default
256 Require user @SYSTEM
257 Order allow,deny
258 Deny From None
259 Allow From 127.0.0.1
260 </file>
262 To modify permissions on the printer you need to know the details of the bus and device. For this, we do as root:
264 <code>
265 root@slitaz:# lsusb
266 </code>
268 And get the following output:
270 <code>
271 Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
272 Bus 001 Device 002: ID 04f9:0027 Brother Industries, Ltd HL-2030 Laser Printer
273 </code>
275 You can now change the permissions on the associated file:
277 <code>
278 root@slitaz:# chmod 666 /dev/bus/usb/001/002
279 </code>
281 And then start cups:
283 <code>
284 root@slitaz:# /etc/init.d/cupsd start
285 </code>
287 We can now configure the printer and fetch the openprinting ppd file for that printer
288 model: http://www.openprinting.org/printer/Brother/Brother-HL-2030 and also add the following
289 packages: foomatic-filters foomatic-db foomatic-db-engine:
291 <code>
292 root@slitaz:# tazpkg get-install foomatic-filters
293 root@slitaz:# tazpkg get-install foomatic-db
294 root@slitaz:# tazpkg get-install foomatic-db-engine
295 </code>
297 Now we can restart cups and point midori to http://localhost:631
299 Cups then asks for:
301 - The login "root" (default tux)
303 - The corresponding password.
305 Then navigate to > Printers > Add Printer > click on the printer name that you recognize and do not forget to indicate the path in the connection box: ///dev/bus/usb/001/002// (in my case).
307 Then go to the web interface of cups ppd and install the new printer using the file Brother HL-2030-hl1250.ppd located in the user's account. Now you can automatically restart cupsd each time you start the system by using System Tools (in the menu) -> Control box -> Initialization and allow the cupsd daemon to run by adding it to the 'Run daemons' section:
309 <file>
310 dbus hald firewall slim cupsd
311 </file>
313 ===== Installing a HP Printer =====
315 <note>This is for a clean installation of SliTaz GNU/Linux cooking-20100314</note>
317 - With the printer plugged in and powered on, run <code>
318 # su root
319 # tazpkg recharge
320 # tazhw setup printer</code>
321 - Install only hplip and hal-cups-utils
322 - The printer should show up in the list of printers displayed as part of this command. It will then attempt to open the CUPS admin pages in Midori (at http://localhost:631 )
323 - On my system, the printer does not show up in the browser under 'Find printers' and I get a 'Forbidden' error when trying to add a printer via the browser
324 - Instead, run <code># hp-setup</code> and follow the instructions. The test page should print correctly. The printer should also show up in the list of printers in applications (like the text editor) and will also appear in the list of printers on the CUPS browser pages, although in my case it is still not possible to make any changes to it
326 ===== Installing a HP All-In-One Printer/Scanner =====
329 === Preparation & Packages ===
331 Power on the scanner before installing the following packages:
333 * xsane
334 * sane-backends
335 * libusb
336 * libusb-compat
337 * usbtools
338 * usbutils
340 <note tip>You can automate the process with the following Bash command as //root// user:
341 <code>for PKG in xsane sane-backends-libusb libusb-compat usbtools usbutils; do
342 tazpkg get-install $PKG
343 done</code>
344 </note>
346 === Detection ===
348 With those packages installed, use the Hardware Detection Tool (Menu > System Tools > Hardware Detection And Drivers)
349 Click on Scanner button
351 If your scanner does not show up immediately, enter for none in my set-up; now the scanner device should be listed in purple text, e.g.:
353 <file>/dev/bus/usb/004/002</file>
355 === Verify Permissions ===
357 Your scanner must be in scanner group with 666 permissions
359 <code>$ crw-rw-rw- 1 root scanner 189, 385 Jun 22 19:44 /dev/bus/usb/0 </code>
361 Reply y to start scanner
362 Warning pops up about running scanner as root
363 Click continue at your own risk button
364 Agree to license
366 Xsane should open and be working!
368 The //tux// user is automatically added to scanner group, so tux may scan, but if you run under another user name that user can't scan until you add them to //scanner// group. Do this with the command (as //root//):
370 <code># addgroup //username// scanner</code>
372 ===== Links ====
374 * http://www.openprinting.org/printers
376 ===== TODO =====
378 * Parallel Printer
380 ----
381 \\
382 ^ Page Review Section ^^
383 |Quality| Low |
384 |Review| Major Updates FIXME |
385 |Priority| Medium |
386 |Problems| add a [[http://forum.slitaz.org|forum post link]]|
387 |::: | OR add a [[http://labs.slitaz.org/issues |lab issue tracker link ]]|
388 |How to Improve| Suggest briefly|
389 |::: | |
391 \\
392 ----