Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast
    Join Date
    Dec 2011
    Turtle Island West

    cat FILE > /dev/lp0 finally works!

    I thought I'd post this here because it took me so long to get it working and I might save someone else a big headache.

    I bought a Samsung ML-1660 printer recently, a monochrome laser printer that was on sale for $69. I immediately tested it out with XP and it prints beautifully, but the paper feed is a bit wimpy and tends to slurp up multiple sheets on larger print jobs. No big deal, I don't intend to be printing out huge manuals and stuff anyway.

    In linux, I have no idea why, but CUPS has never worked properly. It's so convoluted and nearly impossible to configure correctly. So after messing with that for quite a while, downloading fresh source, etc I finally gave up on it.

    Samsung has a Unified Linux Driver on their site, so I downloaded it and checked it out. It is totally based upon the assumption that you have CUPS working. Too bad for me.

    After MUCH messing around, this is what I discovered:

    Whatever FILE you want to print, convert it to postscript. The is a multitude of converters (ImageMagick, pdftops, enscript, et al) that are pretty much standard on every linux distro.

    The only files you need from the Samsung driver package are:

    raster2samsungspl (a binary)
    ML-1660.ppd (a text file)

    Strangely enough raster2samsungspl _requires_ 6 command line arguments:

    1. job_id
    2. user
    3. title
    4. #copies
    5. options
    6. and last but not least, the

    All of these arguments are completely ignored, but are also completely required, so you can go:
    raster2samsungspl 1 1 1 1 1
    And it does nothing. No complaint. Nothing. Just fails silently.

    So, even that is not enough to convert into the FILE.spl that the printer needs to do it's job.

    After using a hexeditor on raster2samsungspl, I discovered an error string near the end of it:
    PPD ERROR: Environment variable PPD undefined or empty?
    AHA! You need to tell it where the FILE.ppd is too. Why doesn't say that? God only knows. If it expects you to have CUPS running, why doesn't it look in /etc/cups/? I dunno.

    So now we have the command:
    export PPD=/etc/cups/ml1660.ppd raster2samsungspl 1 1 1 1 1
    And we finally have many pages of gibberish dumped to the screen. We're getting close...

    Modify that to go:
    export PPD=/etc/cups/ml1660.ppd raster2samsungspl 1 1 1 1 1 > FILE.spl
    And WOW! I now have a file that prints in full monochrome glory!
    cat FILE.spl > /dev/lp0
    And then I went and upgraded ghostscript from 7.07 to 8.01 for a reason I cannot remember, and the whole thing broke. Postscript files were now unusable so the printer driver coughed errors and failed.

    In using gsview to look at the PSFILEs, it always complained about missing fonts and failed also.

    Ghostscript needs a Fontmap in /usr/local/share/ghostscript/8.01/lib/
    and, oh boy, it is not forgiving about that one. You also need to tell it where to find the thing too. It's not good enough just to export the GS_LIB and stuff like the manpage says, you have to tell the individual programs that use gs where to look.

    So now our print command goes like this:
    GS_FONTPATH=/usr/local/share/ghostscript/8.01/Resource/Font/ \
    GS_LIB=/usr/local/share/ghostscript/8.01/ \
    export PPD=/etc/cups/ml1660.ppd \
    raster2samsungspl 1 1 1 1 1 \
    > FILE.spl
    And you have FILE.spl that you can happily type:
    cat FILE.spl > /dev/lp0
    as many times as you want for as many copies as you want and it _actually_ prints.

    Woo hoo! (Do a little jig and kiss the wife)

    I hope someone else can avail themselves of this information.

  2. #2
    Thanx fo this information.

    I was hesitating in buying a Samsung, and I finally bought a HP Laserjet CP1025 color. As professionnal, I'm printing much, around 2500 sheets a year.

    Running LinuxMint 13, the HPLIP is version 3.12.2, and it doesn't print well on the Laserjet. What I did is :

    Changing the main repository from "precise" to "quantal"
    sudo apt-get update
    sudo apt-get install hplip
    sudo hp-setup -u
    Changin the main repository from"quantal" to "precise"
    sudo apt-get update

    And the Laserjet runs fine now.

  3. #3
    Linux Enthusiast
    Join Date
    Dec 2011
    Turtle Island West
    Hello Captain.

    Your welcome. I like the elegant simplicity of cat FILE > /dev/lp0. No BS.

    That is weird. I'm not familiar with LinuxMint. Were the drivers from the older distro or the newer?

  4. $spacer_open
  5. #4
    Hi Miven.

    I'm trying to stick with the softwares inside repositories, the "" system is a good way to break things apart. LinuxMint 13 is derivated from Ubuntu 12.04 LTS. Same repositories, same software versions. That's the reason why it's HPLIP 3.12.2. By treking through quantal (Ubuntu 12.10), I have access to the whole new Ubuntu12.10 repositories, in which HPLIP is in version 3.12.6. ; this version solves the problem with my brand new Laserjet Color (only 149 euros).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts