Posted by r0bis on Tue 8 Sep 2009 at 13:32
I bought the relatively inexpensive Canon LBP5100 colour laser printer for my XP machine at home. I thought I would crack network printing from Linux soon.
The method here should work for just about any printer
After a long chase for information about CAPT and amd64 and multiple failed installations (with compiling from "source") of the CAPT 1.80 driver from Canon I understood that actually colour printing from 64-bit linux would be next to impossible with this printer.
I almost got everything working but the error: pstocapt3 write errors 9 and 32 got me every time. I could not understand whether this was - likely printing to a local spool file, or was it writing to Canon printer over Samba that failed. Might be the latter, since the printer stopped responding to normal jobs from windows an I had to re-install windows driver.
Almost accidentally I came accross this excellent HOWTO_Canon_LBP_2900_with_Samba page on Gentoo wiki. It explains everything in very good detail, therefore I will put only a summary of necessary actions here.
What to do to get your Canon CAPT printer working from Linux over Samba
- Install your Canon driver for windows on the corresponding computer.
- Install Ghostscript on your Windows computer.
- Install Ghostview on your Windows computer.
- Test you can print with Ghostview (open an example file in your Ghostscript installation directory).
- Set up Ghostprint config file. (gsprint.cfg in same directory as gsprint.exe, which in turn in your Ghostview installation directory)
- Install a standard postscript driver on your Windows machine. This should be of a printer that has readily available drivers both on Windows and Linux. The author chose Apple Laser Writer II (which is a BW printer); I chose HP Color Laser Jet 8500 PS. When installing choose "Print to File" port. Test if you can print anyhing on it - the system should ask you for a file name and produce > 0 lenght output.
- Install redmon. That is download, unzip in your directory of choice, then run setup.exe.
- Create a redirected port for your PS printer driver. Properties | Add Port | Redirected port. Name port as you wish:
- Configure the redirected port.
- Redirect to program: enter / browse path to your GSPRINT.EXE
- Arguments for program: - a single dash, with no spaces at all. Alternatively you could use your options to ghostprint here.
- Output: Program handles output
- Run as user: [ ] (unchecked)
- Test if you can print anything on the PS printer. There may be cmd window blink. You should now get output in your Canon printer tray.
- If success - share the printer. The hardest part is over.
- I presume you have SAMBA set up in such a way that you can browse/use files from your Linux box on the Windows box.
- in your browser open http://localhost:631 - this is CUPS administration interface.
- Choose Add printer under Management. Enter names / dscriptions as you like. For printer device select "Windows Printer via Samba".
- then for URI you will enter smb://username:password@workgroup/machine/yourNewPSprinterShare . I created a new non-admin user on Windows specifically for not leaving my XP admin account password in CUPS config files. Might also work w/o password at all.
- Select make and model that you set for your Windows PS printer. If not readily available you can download a lot of *.ppd files + get recommendations on how they work from Linuxprinting.
- That should be it. Select your new printer in CUPS and print a test page.
- smile, if appropriate :)
A few notes:
* if there is some cutting/cropping of edges at times - remember that you cannot set page size/shrinking etc via command line options in ghostprint. That is done in the actual printer driver - so you can experiment with the new PS driver or rather the Canon driver - on windows.
* At some point I also installed Print services for Unix via Windows setup, but I did it when I was desperately trying to make CAPPT drivers work. I don't think that has any relevance.
* if you fail to find redmon download, do search for "redmon17.zip" - Google should give you quite a few working mirrors.
* Not all your linux programs will print correctly. e.g. Inkscape did not print SVG file. You enable can log & debug under the virtual PS printer if you edit (configure) the redirected port.
**** There you can set logfile; you can also set debug - if needed. And there you also can set the DOS window to be hidden.
Your Canon printer is less of paperweight now :)
Your comments and improvements are very welcome
This article can be found online at the Debian Administration website at the following bookmarkable URL (along with associated comments):
This article is copyright 2009 r0bis - please ask for permission to republish or translate.