== A CUPS and eCS (OS/2) How To == Author: Peter Brown email: losepete@ntlworld.com CONTENTS Brief Preamble Why install CUPS? - and what is it? List of required software Brief description of the software packages Installation Configuration of CUPS Printer Creating a Desktop Printer Object to use with CUPS OS/2 Users - Creating the OS/2 printer driver eCS Users - Creating the OS/2 printer driver Common to both eCS and OS/2 Users Troubleshooting Brief Preamble[[BR]] ============== 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. Why install CUPS? - and what is it?[[BR]] =================================== 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. List of required software[[BR]] ========================= eCS and OS/2 Users CUPS port - http://download.smedley.info/cups-1.3.7-gplgs-8.62-gutenprint-5.2.0-beta3-os2-20080616.zip LibC files required - http://download.smedley.info/libc064x.zip - ftp://ftp.netlabs.org/pub/gcc/libc-0.6.3-csd3.zip Updated PIN.EXE package - ftp://ftp.netlabs.org/pub/ecups/work/pinfix.zip eCUPS printer port - http://download.smedley.info/cupsportdriver-20080628.zip cleanppd - http://download.smedley.info/cleanppd.cmd *Not Required* if using InstPDR; see "eCS Users only" below PRNDRV.EXE - http://www.os2site.com/sw/comm/faxworks/prndrv.exe Also required is ps30822xx.zip - where xx is language specific ie English is ps30822en.zip - I have had no success with pscript.drv 30.827; no idea why 30.827 is a "dog"... but 30.822 works fine. To obtain ps30822en.zip I had to login at ecomstation, click on Download the latest software and updates, search for Printer and then select the Postscript printer driver (English) build 30.827, click download update and make a note of the ftp login details on the displayed download page to be able to login to the ftp server and browse the directory to get the 30.822 build. Your ftp line should look something like this:- ftp://userid:password@ftp.ecomstation.com/Printer/ Obviously you need to replace userid and password with whatever values are displayed while pretending you want to download the 30.827 build. Not sure where OS/2 Users can get a copy of the 30.822 build... eCS Users only (could also be grabbed by OS/2 Users as it is "free" of the ecomstation betazone) -------------- Download and install this instPDR package http://download.smedley.info/instpdr_104.zip Brief description of the software packages[[BR]] ========================================== CUPS consists of several packages that work together to provide postscript printing on raster printers The LibC files are required support files The updated PIN.EXE package is used to add the PPD file to the OS/2 pscript.drv file The eCuPS printer port provides the "hook up" between the OS/2 Printer Object and the CUPS printer The cleanppd.cmd file removes unwanted lines from the PPD file that will be used in creating the required OS/2 postscript driver - these lines cause silly problems if left in the PPD file PRNDRV.EXE - a useful command line utility for listing installed printers and deleting those that are not wanted I think I said enough about the requirement for pscript.drv build 30_822 already... InstPDR is a GUI to update printer drivers and add PPD files to pscript.drv; A highly recommended way to update (or backlevel) printer drivers and also to add PPD files; much easier than the "manual" way of adding a PPD file. This build also strips out the same unwanted lines as the modified cleanppd.cmd mentioned in Troubleshooting. The instPDR package is only available to those with a login at ecomstation.com usually; OS/2 Users may want to grab a copy while it is going and make life easier... Installation[[BR]] ============ Put the PRNDRV.EXE file somewhere that you can find it; I put it into J:\Programs\Utils\PrnDrv Unzip InstPDR to a similar useful location; I unzipped it into J:\Programs\Utils\InstPDR and then created a Desktop Program Object, InstPDR, in Desktop -> Programs -> Utilities from the instPDR.exe file (RMB on the executable and select Create program object) The libc0*.dll files should be put into either \ecs\dll or \os2\dll The basic CUPS Install consists of unzipping the package: The CUPS package MUST be unzipped to the ROOT of the drive, which should give you 3 new directories: \cups, \gutenprint and \gs NOTE: the readme.os2 file will end up in the drive root directory unless unzipped seperately into the \cups directory - which is how I unzipped it. Have a read of the 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 Configuration of CUPS Printer[[BR]] ============================= The brief mention of USB in the CUPS readme file suggests that it is possible to use cups with a USB connected printer by creating an OS/2 printer object that uses the USB printer port, start the OS/2 lpd daemon (\tcpip\bin\lpd.exe) and print to the USB printer by setting the cups printer to use Device: lpd://localhost/printer_name when setting up that printer where localhost can be the ip address 127.0.0.1 and printer_name is the name of the OS/2 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. 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: LPD/LPR Host or Printer - type of Device connection Continue - click when happy with above section Device URI: lpd://192.168.2.1/lpt1 - address of device Continue - click when happy with above section Make: Canon - select printer make 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... Creating a Desktop Printer Object to use with CUPS[[BR]] ================================================== 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). The process is slightly different for eCS and OS/2 Users due to the InstPDR software available to eCS Users from the ecomstation betazone; InstPDR is a graphical interface that helps with this job. I will work through the manual method for OS/2 Users and follow that with the method using InstPDR for eCS Users - who can perform the manual method if they prefer... OS/2 Users - Creating the OS/2 printer driver[[BR]] --------------------------------------------- 1] Create your own space for the job [H:]md \temp\printer 2] and somewhere to play with the PPD file [H:]md \temp\printer\ppd 3] Unzip a "virgin" - never been touched before - ps30822xx.zip file to H:\temp\printer 4] Unzip pinfix.exe into H:\temp\printer to overwrite the pin.exe and ppdenc.exe supplied with the ps30822xx package 5] Copy the cleanppd.cmd file to h:\temp\printer\ppd\cleanppd.cmd 6] Copy the required PPD file to h:\temp\printer\ppd eg:- [H:]Copy h:\cups\etc\cups\ppd\PIXMA.ppd h:\temp\printer\ppd\PIXMA.ppd 7] Run cleanppd against the PIXMA.ppd file to generate temp.ppd in the same directory eg:- [H:\temp\printer\ppd]cleanppd PIXMA.ppd 8] Check that H:\temp\printer\ppd\temp.ppd exists then Delete the H:\temp\printer\ppd\PIXMA.ppd file 9] Go up a directory [H:\temp\printer\ppd]cd .. 10] Run pin.exe against the temp.ppd file to add it to the virgin ps30822 pscript.drv [H:\temp\printer]pin ppd H:\temp\printer\ppd H:\temp\printer\pscript.drv Note: the above command will add *ALL* PPD files found in H:\temp\printer\ppd hence the reason for deleting PIXMA.ppd in step 8] You should see this at the end of the procedure indicating success:- ...... OK (Canon PIXMA iP4000) done: 1 devices converted, 0 failed FINISHED, SHUTTING DOWN done [H:\temp\printer] A quick look in the [H:\temp\printer] directory should reveal a new file, auxprint.pak Double clicking the H:\temp\printer\pscript.drv to open it should show the printer that was added; I have a Canon PIXMA iP4000 added to the printers displayed by that driver. 11] The next step is to replace any existing installation of pscript.drv with this version. Open a command line window in the \os2\dll\pscript directory and delete all files - you need to perform this from the command line as the WPS will not delete the pscript.drv file but the command line will. [H:\OS2\DLL\PSCRIPT]del *.* 12] Having deleted the existing files copy the pscript files from H:\temp\printer [H:\OS2\DLL\PSCRIPT]copy H:\temp\printer\*.* 13] Open the Desktop -> Templates folder and drag the Printer template to the Desktop to start the Create printer routine; You may need to point the install routine to h:\os2\dll\pscript and click Refresh in order to see the printer listed 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 eCS Users - Creating the OS/2 printer driver[[BR]] -------------------------------------------- The following is based on my eCS1.2R system and paths may need to be modified for other versions of eCS 1] Unzip a "virgin" - never been touched before - ps30822xx.zip file into H:\temp\printer 2] Unzip pinfix.exe into H:\temp\printer to overwrite the pin.exe and ppdenc.exe supplied with the ps30822xx package 3] Zip all files H:\temp\printer\*.* into H:\temp\printer\ps30822xx_NEW.zip - this file will be used by InstPDR to update the existing pscript driver files 4] Start InstPDR Select to "Update standard eComStation driver package" and click Begin Use the "Select Driver Package" file picker to select the H:\temp\printer\ps30822xx_NEW.zip file and click OK A successful update will be indicated by the "Update Complete" message. Select to "Import Postscript Printer Description" and click Begin Use the "Select PPD File" file picker to select the h:\cups\etc\cups\ppd\PIXMA.ppd file and click OK A successful update will be indicated by the "Done" message window:- Updating driver table ... The following printers have been imported into the PostScript driver: Canon PIXMA iP4000 Select "OK" to close this window. 5] Having added the printer PPD file now create the Desktop Printer Object by running the Desktop -> Local System -> Install Local Printer routine 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. Common to both eCS and OS/2 Users[[BR]] --------------------------------- Unzip cupsportdriver-20080628.zip cups.pdr into h:\os2\dll cupslpr.exe into h:\tcpip\bin 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 the CUPS printer) 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 You can repeat the above test using the \cups\share\cups\data\PReCS20.ps file to test 2 page document printing. Both tests were successful here. I then successfully printed a jpeg image from PMView2000, a 2 page document from OpenOffice115 Writer, a 3 page PDF document from Lucide, a section of the WDSibyl help viewed using NewView and a source file in use in WDSibyl using my newly created "postscript" PIXMA printer. NOTE: As mentioned above in the section "Right Mouse Button on the new Desktop Printer Object and select Properties" Settings for print jobs should be the same in both the OS/2 printer Job properties and the CUPS printer settings to avoid problems with output such as wrong size text. Troubleshooting[[BR]] =============== Not much to put in here except: If things go wrong when adding the PPD file to the OS/2 pscript.drv the PRNDRV.EXE utility will come in handy. This can list and delete printers and queues - which I found useful during my early attempts to create an OS/2 pscript printer using the relevent CUPS PPD file. I found after working through the "Create a driver" steps that the OS/2 Printer Object eventually created had possible problems. When I was checking the Job properties (Printer driver tab of the Printer Properties) I noticed that the Resolution options listed (on the Output tab) included the options for Duplex printing. On testing printed text output from OpenOffice115 Writer was extremely small. I made a few modifications to the temp.ppd file and prepared to create a new printer based on this modified file. I deleted the existing OS/2 Desktop Printer Object, PIXMA pscript.drv files in \os2\dll\pscript from the command line:- [H:\OS2\DLL\PSCRIPT]del *.* I then used the prndrv.exe utility delete any traces left in the ini files. Using the prndrv -l command I see the following (after deleting the OS/2 Printer Object and the pscript.drv files):- [J:\Programs\Utils\PrnDrv]prndrv -l PrnDrv -- OS/2 Printer Driver Installer/Deinstaller Developed by Keller Group Inc. Copyright (c) 1991-1999 Keller Group Inc. All rights reserved. Found PrintQueue 'CanoniP4' PMPRINT Found PrintQueue 'i950' PMPRINT Found PrintQueue 'PSCRIPTH' PMPRINT Found Printer 'CanoniP4' SLPR1 OMNI.Canon i850,OMNI.Canon i950,PSCRIPT.HP Busine ss Inkjet 2250 PS Found PrinterDriver 'PSCRIPT.Canon iP4000' 'H:\OS2\DLL\PSCRIPT\pscript.drv' Found PrinterDriver 'PSCRIPT.HP Business Inkjet 2250 PS' 'H:\OS2\DLL\PSCRIPT\pscript.drv' Found PrinterDriver 'IBMNULL' 'H:\OS2\DLL\IBMNULL\IBMNULL.DRV' Found PrinterDriver 'OMNI.Canon i950' 'H:\OS2\DLL\OMNI\OMNI.DRV' Found PrinterDriver 'OMNI.Canon i850' 'H:\OS2\DLL\OMNI\OMNI.DRV' The PIXMA printer was using the 'PSCRIPT.Canon iP4000' printer driver The use of prndrv -d "unique identifier" removes the unwanted entries:- [J:\Programs\Utils\PrnDrv]prndrv -d PSCRIPT.Canon PrnDrv -- OS/2 Printer Driver Installer/Deinstaller Developed by Keller Group Inc. Copyright (c) 1991-1999 Keller Group Inc. All rights reserved. Found PrinterDriver 'PSCRIPT.Canon iP4000' 'H:\OS2\DLL\PSCRIPT\pscript.drv' deleted INI PM_DEVICE_DRIVERS:PSCRIPT deleted SYSINI PM_DEVICE_DD:PSCRIPT.Canon iP4000 [J:\Programs\Utils\PrnDrv]