''' == A CUPS and eCS (OS/2) How To == ''' Revision 1 14/08/2008[[BR]] Author: Peter Brown[[BR]] Revisions to filenames 29/12/2008 - Paul Smedley Revisions to USB section 29/03/2009 - Paul Smedley email: losepete@ntlworld.com[[BR]] [[BR]] [[BR]] == CONTENTS == [[BR]] '''Brief Preamble''' '''Why install CUPS? - and what is it?''' '''List of required software''' '''Brief description of the software packages''' '''Installation''' '''Configuration of CUPS Printer''' '''Local printers - Parallel attached''' '''CUPS printers - Network attached and USB attached''' '''Creating a Desktop Printer Object to use with CUPS''' [[BR]] [[BR]] [[BR]] ''' Brief Preamble''' Hopefully this text will provide a clear enough "How To" for anyone to be able to follow. I am using my experience of getting a Canon PIXMA iP4000 inkjet printer working with, firstly, CUPS and then creating an OS/2 Printer Object that is capable of outputting print jobs through CUPS. I do use specific Drive Letter(s) in the following text that would need to be changed to reflect the correct drive letter on other systems. Most of the Paths used are specific to the CUPS installation; those that are not would need to be changed for other systems. [[BR]] [[BR]] [[BR]] '''Why install CUPS? - and what is it?''' Common Unix Printing System answers the "what is it?" bit. Why install CUPS? - Simply because it is capable of supporting a lot of modern printers and is continually updated. The old OS/2 printer drivers are not that good, if you can find a driver that works, with modern raster printers and those drivers will not be updated. CUPS can provide drivers for more current printers - and should provide any extra capabilities missing from the OS/2 drivers. The object of the exercise is to end up with an eCS(OS/2) postscript printer object that prints using CUPS. [[BR]] [[BR]] [[BR]] '''List of required software''' CUPS port - See http://svn.netlabs.org/ecups/wiki/CupsPort for the latest releases of CUPS, Ghostscript, Gutenprint, eCUPS, Cups.pdr and Splix(for Xerox printers only) eCUPS printer driver package - see http://svn.netlabs.org/ecups/wiki/CupsPort for the latest release eCUPS printer port - http://download.smedley.info/cupsportdriver-20080628.zip Libc files required for CUPS - ftp://ftp.netlabs.org/pub/gcc/libc-0.6.3-csd3.zip Libc files required for eCUPS printer port - http://download.smedley.info/libc064x.zip PRNDRV.EXE (this is a program that will "clean up" printer entries in the INI files) - http://www.os2site.com/sw/comm/faxworks/prndrv.exe [[BR]] [[BR]] [[BR]] '''Brief description of the software packages''' CUPS consists of several packages that work together to provide postscript printing on raster printers (CUPS, Ghostscript, Gutenprint, eCUPS, Cups.pdr and Splix(for Xerox printers only)). All of these packages should be expanded under the root directory of a drive (doesn't have to be the boot drive) - so once expanded you will have the following directories off the root directory: CUPS GUTENPRINT GS\GSN.nn (where N.nn is the Ghostscript version number e.g. 8.64) - note you may need to create the \GS directory depending upon the contents of the GS zip file you download. The Libc files are required support files put these in a directory in the libpath - e.g. ecs\dll or os2\dll The eCUPS printer driver is an alternative OS/2 pscript.drv package and has most of the popular CUPS PPD files already included. (This file should be put into a directory under \OS2\DLL - my suggestion is \OS2\DLL\CUPS - you will then point the printer install dialog at this directory during the install process) The eCUPS printer port provides the "hook up" between the OS/2 Printer Object created from the eCUPS printer driver and the CUPS printer ( copy cupslpr.exe into \tcpip\bin and cups.pdr into \os2\dll) PRNDRV.EXE - a useful command line utility for listing installed printers and deleting those that are no longer wanted [[BR]] [[BR]] [[BR]] '''Installation''' Put the PRNDRV.EXE file somewhere that you can find it; I put it into J:\Programs\Utils\PrnDrv The libc0*.dll files should be put into either \ecs\dll or \os2\dll The basic CUPS Install consists of unzipping the packages: * Ghostscript needs to be unzipped into \gs - so that you end up with for example, x:\gs\gs8.64 * cups-1.3.9*.zip needs to be unzipped into ROOT * gutenprint*.zip needs to be unzipped into ROOT At the end of this process, you should have 3 new directories: \cups, \gutenprint and \gs Have a read of the \cups\readme.os2 before proceeding just to get an idea of what you are going to do; especially if attempting to setup a USB printer. Other files are unzipped later as/when/if they are required [[BR]] [[BR]] [[BR]] '''Configuration of CUPS Printer''' [[BR]] [[BR]] '''Local printers - Parallel attached''' CUPS does not currently support printing directly to Parallel printers but there is a workaround. 1] Create a Printer object using the Null printer driver and select the LPTn port as the Output Port in the printer object Properties 2] Start the OS/2 lpd daemon (\tcpip\bin\lpd.exe). To prevent lpd.exe from printing the control file page (an almost blank page with few lines of information good only for debug purpose) specify also the "-c" parameter. When creating the CUPS printer in the below section (CUPS printer) use lpd://localhost/ as the Device URI: where is the Physical name of the OS/2 Printer object - as shown on the Properties, View page - created in 1] above. Note this may not be the same as the name given to the printer during creation. eg If you created a printer with the object name Canon iP4000 in the Printers folder open the Properties for that printer and check the name displayed on the View page - it shows CanoniP4 here. So in the above example the device URI should be lpd://localhost/CanoniP4 Thanks to Rodney and others who supplied the above information regarding using locally attached printers with CUPS. [[BR]] [[BR]] '''CUPS printer''' Start \cups\sbin\cupsd.exe I created a program object for this with the Start Minimized and Close Window on exit checked in the Properties, Session tab; the object Properties should also have the Working directory set as Drive:\cups\sbin (where Drive is the drive letter that cups is installed to). This object can be put in the Startup folder so that cupsd.exe is started automatically at bootup. As the CUPS browser admin interface seems to be working here I recommend using that interface to Add a Printer. Fire up your browser and point it at http://localhost:631/ (cups home page) and when that has loaded click Add Printer. I added the following Canon PIXMA P4000 colour inkjet (raster) printer and will be using this printer as the example. The text after the "-" is to outline the purpose Name: PIXMA - what you want to call the printer Location: Router LPT1 - where it is physically located; ie connected to the Router's LPT1 port Description: Canon PIXMA iP4000 Inkjet - brief description of printer Continue - click when happy with above section Device: Choose an appropriate selection for device connection: ie: LPD/LPR Host or Printer IPP for USB printers - the detected printer should be available for selection. For other types of attachment, more information will be required. * Example: Device URI: lpd://192.168.2.1/lpt1 - address of device for LPD printer Continue - click when happy with above section Make: Canon - select printer make - for USB printers, an attempt will be made to confirm the correct PPD file to use Continue - click when happy with above section Model: Canon PIXMA iP4000 - CUPS+Gutenprint v5.2.0-beta3(en) Simplified - select correct driver; Simplified recommended Add Printer - click when happy with above section After clicking Add Printer the interface informs me that the printer has been added and loads the options for the printer - this can take a little while. It is a good idea to have a look through and make sure the options look useable - especially Media Size, Resolution and Image Type. When satisfied click Set Printer Options and the interface reports "Printer PIXMA has been configured successfully." I then clicked on the Printers tab and then clicked the Print Test Page button. Shortly after the Test Page popped out of the printer looking fine. Well, that is the very easy bit finished... Referring to the readme.os2 file I used the command line to print a 2 page document; I opened a command line window in \cups\bin and gave it a try:- [H:\cups\bin]lpr -P PIXMA \cups\share\cups\data\PReCS20.ps After a short wait the printer burst into action and delivered 2 pages of output that look fine. That is the next easy bit finished... [[BR]] [[BR]] [[BR]] '''Creating a Desktop Printer Object to use with CUPS''' Now to hook CUPS up to the rest of the system so that CUPS can be used for output by applications such as OpenOffice Writer (wordprocessor) and PMView (images). 1] Unzip the eCUPS printer driver package (At time of writing ecups-20081228.zip) into h:\os2\dll\ecups - this avoids any problems with any existing postscript driver in h:\os2\dll\pscript. 2] Open the Desktop -> Templates folder and drag the Printer template to the Desktop to start the Create printer routine. You will need to point the install routine to h:\os2\dll\ecups and click Refresh in order to see the list of printers. Name the printer - PIXMA in this case Select the output port - I used LPT1 initially and installed the cups printer port later Select the (pscript) driver for the printer - Canon PIXMA iP4000 3] Unzip the eCuPS printer port package (currently cupsportdriver-20080628.zip) putting the files into these locations cups.pdr into h:\os2\dll cupslpr.exe into h:\tcpip\bin 4] Right Mouse Button on the new Desktop Printer Object and select Properties Select Printer driver tab Check the Default printer driver is correctly selected Set Job Properties: Paper Size, Tray, Media Type, Resolution must match the settings in the CUPS printer - and Save Select Output port tab Click Install new port button Select the CUPS1 port and click Install - if the port is not visible but the CUPS.pdr file is in \os2\dll Click New port drivers and set the directory to \os2\dll and click Find. The CUPS ports should appear. The settings for the CUPS port are Host: localhost - or use 127.0.0.1 Printer: PIXMA (this should be the same name as used for creating the CUPS printer in the CUPS admin above) Close Printer Properties That should be setup complete so time to print a test page Verify that cupsd.exe is running *Before* testing Drag'n'Drop \cups\share\cups\data\testprint.ps onto the new Desktop Printer Object Select Printer-specific in the following dialog You should get the CUPS Test Page printed from your OS/2 Desktop Printer Object The next test is to print a multiple page document from your favourite wordprocessor, followed by printing any other document types from an appropriate application, eg Photos from PMView, using your new OS/2 Desktop Printer.