SliTaz GNU/Linux official and community documentation wiki.
.png

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:guides:printer [2010/06/23 11:00]
seawolf added info from Mojo on forum
en:guides:printer [2010/10/15 19:22] (current)
linea add usb printer (fr translation)
Line 1: Line 1:
 ====== Printing ====== ====== Printing ======
  
-===== Installing ​HP printer =====+The CUPS (Common Unix Printing System) software manages printers connected to the local computer or over network. The local printers are attached via a loop-back connection (IP 127.0.0.1), a network connection pointing to the same system.
  
-This is for a clean installation of SliTaz GNU/Linux cooking-20100314+===== Installing a Network Printer ===== 
 + 
 +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: 
 + 
 +<​code>​ 
 +# tazpkg get-install cups 
 +# addgroup tux lp 
 +</​code>​ 
 + 
 +Again as root, customise the default configuration in /​etc/​cupsd.conf:​ 
 + 
 +<​file>​ 
 +# Administrator user group... 
 +SystemGroup lp 
 + 
 +# Restrict access to the admin pages... 
 + 
 +  Order allow,​deny 
 +  Allow 127.0.0.1 
 + 
 + 
 +# Restrict access to configuration files... 
 + 
 +  AuthType Default 
 +  Require user @SYSTEM 
 +  Order allow,​deny 
 +  Deny From None 
 +  Allow From 127.0.0.1 
 +</​file> ​  
 + 
 +Set the administrative password for CUPS and add an administrative user: 
 + 
 +<​code>​ 
 +# lppasswd -g lp -a tux 
 +</​code>​ 
 + 
 +You should now be able to have access to the CUPS administration through your browser by entering the address ''<​nowiki>​http://​localhost:​631/</​nowiki>''​ 
 + 
 +Install the printer drivers with the following packages: 
 + 
 +    - hplip : for HP printers 
 +    - gutenprint : for Canon, Epson, Lexmark, Sony, Olympus 
 +    - foomatic-db,​ foomatic-db-engine,​ foomatic-db-nonfree and foomatic-filters : several free software printer drivers 
 +    - ufr2: for Canon printers (extra drivers) 
 +    - splix: for Samsung 
 +    - cups-pdf: for "​printing"​ to PDF files 
 + 
 +For example, install the HP printer drivers with the following //root// command 
 +<​code>​ 
 +# tazpkg get-install hplip 
 +</​code>​ 
 + 
 +Now you add a new printer in the browser interface and choose: 
 + 
 +<​nowiki>​LPD/​LPR Host or Printer (Unknown),​ 
 +and add the address socket//​192.168.2.1:​9100</​nowiki>​ 
 + 
 +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. 
 + 
 +  * ''​mime.convs''​ (/​etc/​cups/​mime.convs):​ 
 +<​file>​ 
 +application/​pdf application/​postscript 33 pdftops 
 +application/​postscript application/​vnd.cups-postscript 66 pstops 
 +application/​vnd.hp-HPGL application/​postscript 66 hpgltops 
 +application/​x-cshell application/​postscript 33 texttops 
 +application/​x-csource application/​postscript 33 texttops 
 +application/​x-perl application/​postscript 33 texttops 
 +application/​x-shell application/​postscript 33 texttops 
 +text/​plain application/​postscript 33 texttops 
 +text/​html application/​postscript 33 texttops 
 +image/​gif application/​vnd.cups-postscript 66 imagetops 
 +image/​png application/​vnd.cups-postscript 66 imagetops 
 +image/​jpeg application/​vnd.cups-postscript 66 imagetops 
 +image/​tiff application/​vnd.cups-postscript 66 imagetops 
 +image/​x-bitmap application/​vnd.cups-postscript 66 imagetops 
 +image/​x-photocd application/​vnd.cups-postscript 66 imagetops 
 +image/​x-portable-anymap application/​vnd.cups-postscript 66 imagetops 
 +image/​x-portable-bitmap application/​vnd.cups-postscript 66 imagetops 
 +image/​x-portable-graymap application/​vnd.cups-postscript 66 imagetops 
 +image/​x-portable-pixmap application/​vnd.cups-postscript 66 imagetops 
 +image/​x-sgi-rgb application/​vnd.cups-postscript 66 imagetops 
 +image/​x-xbitmap application/​vnd.cups-postscript 66 imagetops 
 +image/​x-xpixmap application/​vnd.cups-postscript 66 imagetops 
 +image/​x-sun-raster application/​vnd.cups-postscript 66 imagetops 
 + 
 + 
 +image/​gif application/​vnd.cups-raster 100 imagetoraster 
 +image/​png application/​vnd.cups-raster 100 imagetoraster 
 +image/​jpeg application/​vnd.cups-raster 100 imagetoraster 
 +image/​tiff application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-bitmap application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-photocd application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-portable-anymap application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-portable-bitmap application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-portable-graymap application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-portable-pixmap application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-sgi-rgb application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-xbitmap application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-xpixmap application/​vnd.cups-raster 100 imagetoraster 
 +image/​x-sun-raster application/​vnd.cups-raster 100 imagetoraster 
 + 
 +application/​vnd.cups-postscript application/​vnd.cups-raster 100 pstoraster 
 +</​file>​ 
 + 
 +  * ''​mime.types''​ (/​etc/​cups/​mime.types):​ 
 + 
 +<​file>​ 
 +application/​pdf pdf string(0,​%PDF) 
 +application/​postscript ai eps ps string(0,​%!) string(0,<​04>​%!) \ 
 + contains(0,​128,<​1B>​%-12345X) + \ 
 + (contains(0,​4096,"​LANGUAGE=POSTSCRIPT"​) \ 
 + contains(0,​4096,"​LANGUAGE = Postscript"​) \ 
 + contains(0,​4096,"​LANGUAGE = PostScript"​) \ 
 + contains(0,​4096,"​LANGUAGE = POSTSCRIPT"​) \ 
 + (contains(0,​4096,<​0a>​%!) + \ 
 +   !contains(0,​4096,"​ENTER LANGUAGE"​))) 
 +application/​vnd.hp-HPGL hpgl \ 
 + string(0,<​1B>​E<​1B>​%0B) \ 
 + string(0,<​1B>​%-1B) string(0,<​201B>​)\ 
 + string(0,​BP;​) string(0,​IN;​) string(0,​DF;​) \ 
 + string(0,​BPINPS;​) \ 
 + (contains(0,​128,<​1B>​%-12345X) + \ 
 + (contains(0,​4096,"​LANGUAGE=HPGL"​) \ 
 +   contains(0,​4096,"​LANGUAGE = HPGL"​))) 
 + 
 +########################################################################​ 
 +
 +# Image files... 
 +
 + 
 +image/​gif gif string(0,​GIF87a) string(0,​GIF89a) 
 +image/​png png string(0,<​89>​PNG) 
 +image/​jpeg jpeg jpg jpe string(0,) &&​\ 
 + (char(3,​0xe0) char(3,​0xe1) char(3,​0xe2) char(3,​0xe3)\ 
 + char(3,​0xe4) char(3,​0xe5) char(3,​0xe6) char(3,​0xe7)\ 
 + char(3,​0xe8) char(3,​0xe9) char(3,​0xea) char(3,​0xeb)\ 
 + char(3,​0xec) char(3,​0xed) char(3,​0xee) char(3,​0xef)) 
 +image/​tiff tiff tif string(0,​MM<​002A>​) string(0,​II<​2A00>​) 
 +image/​x-photocd pcd string(2048,​PCD_IPI) 
 +image/​x-portable-anymap pnm 
 +image/​x-portable-bitmap pbm string(0,​P1) string(0,​P4) 
 +image/​x-portable-graymap pgm string(0,​P2) string(0,​P5) 
 +image/​x-portable-pixmap ppm string(0,​P3) string(0,​P6) 
 +image/​x-sgi-rgb rgb sgi bw icon short(0,​474) 
 +image/​x-xbitmap xbm 
 +image/​x-xpixmap xpm ascii(0,​1024) + string(3,"​XPM"​) 
 +#​image/​x-xwindowdump xwd string(4,<​00000007>​) 
 +image/​x-sun-raster ras string(0,<​59a66a95>​) 
 + 
 +#​image/​fpx fpx 
 +image/​x-alias pix short(8,8) short(8,​24) 
 +image/​x-bitmap bmp string(0,​BM) && !printable(2,​14) 
 +image/​x-icon ico 
 + 
 +########################################################################​ 
 +
 +# Text files... 
 +
 + 
 +application/​x-cshell csh printable(0,​1024) + string(0,#​!) +\ 
 + (contains(2,​80,/​csh) contains(2,​80,/​tcsh)) 
 +application/​x-perl pl printable(0,​1024) + string(0,#​!) +\ 
 + contains(2,​80,/​perl) 
 +application/​x-shell sh printable(0,​1024) + string(0,#​!) +\ 
 + (contains(2,​80,/​bash) contains(2,​80,/​ksh)\ 
 + contains(2,​80,/​sh) contains(2,​80,/​zsh)) 
 +application/​x-csource c cxx cpp cc C h hpp \ 
 + printable(0,​1024) + \ 
 + (string(0,/​*) string(0,//​) 
 + string(0,#​include) contains(0,​1024,<​0a>#​include) \ 
 + string(0,#​define) contains(0,​1024,<​0a>#​define)) 
 +text/​html html htm printable(0,​1024) +\ 
 + (istring(0,""​) istring(0,"​)) 
 +text/​plain txt printable(0,​1024) 
 +text/​css css 
 + 
 + 
 +########################################################################​ 
 +
 +# RSS feed type... 
 +
 + 
 +application/​rss+xml rss 
 + 
 + 
 +########################################################################​ 
 +
 +# CUPS-specific types... 
 +
 + 
 +application/​vnd.cups-command string(0,'#​CUPS-COMMAND'​) 
 +application/​vnd.cups-form string(0,""​) 
 +application/​vnd.cups-pdf 
 +application/​vnd.cups-postscript 
 +application/​vnd.cups-ppd ppd string(0,"​*PPD-Adobe:"​) 
 +application/​vnd.cups-raster string(0,"​RaSt"​) string(0,"​tSaR"​) 
 +application/​vnd.cups-raw (string(0,<​1B>​E) + !string(2,<​1B>​%0B)) \ 
 + string(0,<​1B>​@) \ 
 + (contains(0,​128,<​1B>​%-12345X) + \ 
 + (contains(0,​4096,"​LANGUAGE=PCL"​) \ 
 +   contains(0,​4096,"​LANGUAGE = PCL"​))) 
 + 
 +########################################################################​ 
 +
 +# Raw print file support... 
 +
 +# Comment the following type to prevent raw file printing. 
 +
 + 
 +application/​octet-stream 
 +</​file>​ 
 + 
 +<note tip>If at the end of the procedures the printer is not working, restarting the service or computer may help.</​note>​ 
 + 
 +===== Installing an USB Brother HL 2030 Printer ===== 
 + 
 +To install cups, hal-cups-utils,​ usbutils. As root, type: 
 + 
 +<​code>​ 
 +root@slitaz:#​ tazpkg get-install cups 
 +root@slitaz:#​ tazpkg get-install hal-cups-utils 
 +root@slitaz:#​ tazpkg get-install usbutils 
 +</​code>​ 
 + 
 +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. 
 + 
 +Now we can add tux to the lp (printer) group. As root, we do: 
 + 
 +<​code>​ 
 +root@slitaz:#​ addgroup tux lp 
 +</​code>​ 
 + 
 +For the web interface of cups to be properly activated, we still need to change a few things in the ///​etc/​cupsd.conf//​ file: 
 + 
 +<​code>​ 
 +root@slitaz:#​ leafpad /​etc/​cups/​cupsd.conf 
 +</​code>​ 
 + 
 + <​file>​ 
 +   # Administrator user group... 
 +   ​SystemGroup lp 
 +    
 +   # Restrict access to the admin pages... 
 +    
 +   Order allow,​deny 
 +   Allow 127.0.0.1 
 +    
 +    
 +   # Restrict access to configuration files... 
 +    
 +   ​AuthType Default 
 +   ​Require user @SYSTEM 
 +   Order allow,​deny 
 +   Deny From None 
 +   Allow From 127.0.0.1 
 + </​file>​ 
 + 
 +To modify permissions on the printer you need to know the details of the bus and device. For this, we do as root: 
 + 
 +<​code>​ 
 +root@slitaz:#​ lsusb 
 +</​code>​ 
 + 
 +And get the following output: 
 + 
 +<​code>​ 
 +   Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
 +   Bus 001 Device 002: ID 04f9:0027 Brother Industries, Ltd HL-2030 Laser Printer 
 +</​code>​ 
 + 
 +You can now change the permissions on the associated file: 
 + 
 +<​code>​ 
 +root@slitaz:#​ chmod 666 /​dev/​bus/​usb/​001/​002 
 +</​code>​ 
 + 
 +And then start cups: 
 + 
 +<​code>​ 
 +root@slitaz:#​ /​etc/​init.d/​cupsd start 
 +</​code>​ 
 + 
 +We can now configure the printer and fetch the openprinting ppd file for that printer  
 +model: http://​www.openprinting.org/​printer/​Brother/​Brother-HL-2030 and also add the following  
 +packages: foomatic-filters foomatic-db foomatic-db-engine:​ 
 + 
 +<​code>​ 
 +root@slitaz:#​ tazpkg get-install foomatic-filters 
 +root@slitaz:#​ tazpkg get-install foomatic-db 
 +root@slitaz:#​ tazpkg get-install foomatic-db-engine 
 +</​code>​ 
 + 
 +Now we can restart cups and point midori to http://​localhost:​631 
 + 
 +Cups then asks for: 
 + 
 +- The login "​root"​ (default tux) 
 + 
 +- The corresponding password. 
 + 
 +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). 
 + 
 +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:  
 + 
 +<​file>​ 
 +dbus hald firewall slim cupsd 
 +</​file>​  
 + 
 +===== Installing a HP Printer ===== 
 + 
 +<​note>​This is for a clean installation of SliTaz GNU/Linux cooking-20100314</​note>​
  
   - With the printer plugged in and powered on, run <​code>​   - With the printer plugged in and powered on, run <​code>​
-su root +su root 
-tazpkg recharge +tazpkg recharge 
-tazhw setup printer</​code>​+tazhw setup printer</​code>​
   - Install only hplip and hal-cups-utils   - Install only hplip and hal-cups-utils
   - 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 )   - 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 )
   - 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   - 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
-  - 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 +  - 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
- +
  
 ===== Installing a HP All-In-One Printer/​Scanner ===== ===== Installing a HP All-In-One Printer/​Scanner =====
Line 30: Line 338:
   * usbutils   * usbutils
  
-<note tip>You can sutomate ​the process with the following Bash command as //root// user: +<note tip>You can automate ​the process with the following Bash command as //root// user: 
-<​code>​for PKG in xsane snae-backends-libusb libusb-compat usbtools usbutils; do tazpkg get-install $PKGdone;</​code>​+<​code>​for PKG in xsane sane-backends-libusb libusb-compat usbtools usbutils; do  
 +tazpkg get-install $PKG 
 +done</​code>​
 </​note>​ </​note>​
  
Line 41: Line 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.: 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.:
  
-<code>/​dev/​bus/​usb/​004/​002</​code>+<file>/​dev/​bus/​usb/​004/​002</​file>
  
 === Verify Permissions === === Verify Permissions ===
Line 47: Line 357:
 Your scanner must be in scanner group with 666 permissions Your scanner must be in scanner group with 666 permissions
  
-<​code>​ crw-rw-rw- ​   1 root     ​scanner ​ 189, 385 Jun 22 19:44 /​dev/​bus/​usb/​0 </​code>​+<​code>​crw-rw-rw- ​   1 root     ​scanner ​ 189, 385 Jun 22 19:44 /​dev/​bus/​usb/​0 </​code>​
  
 Reply y to start scanner Reply y to start scanner
Line 58: Line 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//): 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//):
  
-<​code>​addgroup //​username//​ scanner</​code>​+<​code>​addgroup //​username//​ scanner</​code>​ 
 + 
 +===== Links ==== 
 + 
 +    * http://​www.openprinting.org/​printers 
 + 
 +===== TODO ===== 
 + 
 +    * Parallel Printer
  
 ----  ---- 
 
en/guides/printer.1277283657.txt.gz · Last modified: 2010/07/08 17:17 (external edit)