This is the old SliTaz forum - Please use the main forum.slitaz.org

Cups how to
  • kultexkultex July 2010
    I just installed my network printer and I have no time to work on usb and parallel printers - so just here and not in the wiki. Perhaps somebody else can continue ...

    do as root in xterm:

    #tazpkg get-install cups
    #addgroup tux lp


    change some lines in /etc/cupsd.conf (#leafpad /etc/cupsd.conf)

    # 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


    set the admin password for cups:

    #lppasswd -g lp -a tux


    now you should be able to have access to administration in cups with your browser with http://localhost:631/

    now you have to install the printer drivers:

    a) hplip : for hp printers
    b) gutenprint : for canon, epson, Lexmark, Sony, Olympus
    c) foomatic-db, foomatic-db-engine, foomatic-db-nonfree and foomatic-filters : several free software printer drivers
    d) ufr2: for canon printers (extra drivers)
    e) splix: for samsung
    f) cups-pdf: for pdf printing

    eg: #tazpkg get-install hplip


    now you add a new printerin the browserinterface and choose:

    LPD/LPR Host or Printer (Unknown)
    and add the address socket//192.168.2.1:9100

    if you get the error: Returning IPP client-error-document-format-not-supported for Print-Job in /var/log/cups/error.log, then you have to add two files to /etc/cups

    first with the name: mime.convs (#leafpad /etc/cups/mime.convs)

    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


    and second file with the name: mime.types (#leafpad /etc/cups/mime.types)

    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,"<!DOCTYPE"))<br />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




  • LineaLinea July 2010
    Hi kultex

    I've added this to the wiki, so that others can edit also.

    Nice work!

    Paul
  • kultexkultex July 2010
    Hi Paul,

    thank you very much and by the way I really love your corrections of my bad english ....

    but I am not very satisfied, because normally the cups Administrator user group is lpadmin - ok on my machine it is no problem to use the group lp, but for a mulitiuser system, I would prefer to use lpadmin.
    groupadd does not work in slitaz and when I add lpadmin to /etc/group cups is not recognizing the group lpadmin.

    Perhaps somebody knows, how to add lpadmin.

    Thomas

  • DarjeelingDarjeeling July 2010
    Excellent tutorial, @kultex ... and wiki, @Linea. Thanks very much for this.

    I've been running SliTaz 3.0 Final since months on a computer that hasn't got a hard disk and that doesn't boot from USB because of a BIOS issue. So, I'm stuck with a CDROM drive and 1 GB of RAM. As I have only one local USB printer I wasn't so happy with hplib and the other driver libraries because they come with tons of unneeded drivers, pull in Python and who knows what else. Size matters and therefore I looked around and I found the driver and the PPD file for my Kyocera printer on this web site ...

    http://www.openprinting.org/printers

    ... which has a large collection of printer drivers for Linux. I downloaded the RPM package of the driver, converted it to tazpkg format and installed it. The driver uses just about 1 MB RAM compared to more than 20 MB for hplib. If the printer is turned on before the Cups web interface is started the interface will probably automatically pick up the printer name, if it's a USB printer. If OpenPrinting also has a PPD file available for the chosen printer model this can be used in the Cups interface instead of a generic or unknown printer. The "Manage Printing" desktop file in usr/share/applications has Firefox hard-coded in it. This should be changed to "browser" so it also works with Midori, Opera and others.

    Maybe you can add the link to the OpenPrinting page to the wiki, Linea?
  • Thank you Darjeeling for the link. Exactly what I needed.
    Cheers.
    Stephane
  • LineaLinea July 2010
    Hi Darjeeling

    Link added (feel free to edit, modify)

    Paul
  • DarjeelingDarjeeling July 2010
    Thanks, Linea.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social