1 | | List of newly supported Epson printers: |
2 | | |
3 | | epl2050 epl2050p epl2120 epl2500 epl2750 epl5800 epl5900 epl6100 epl6200 lp1800 lp1900 lp2200 lp2400 lp2500 lp7500 lp7700 lp7900 lp8100 lp8300f lp8400f lp8600 lp8600f lp8700 lp8900 lp9000b lp9100 lp9200b lp9300 lp9400 lp9600 lp9600s alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 lp3000c lp8000c lp8200c lp8300c lp8500c lp8800c lp9000c lp9200c lp9500c lp9800c |
4 | | |
5 | | Why I made this build. |
6 | | |
7 | | Our company bought Epson AcuLaser C1900 color printer. This model is capable to work PCL5 mode but in B/W mode only and doesn't understand poscript., while I wish to print in color too. So I look for solution and found out that Epson sources are GPL now and exist as GS patch. |
8 | | |
9 | | So I downloaded the latest GS (8.53 at the moment) and the latest Epson GS patch ghostscript-7.07.tar.bz2. I applied the patch (patched sources GS doesn't changed too much from 7.07 to 8.53 version) and built the modules with gcc 3.3.5, what mean that you need lib06 dll (you may take it here ). I also made some minor changes in main GS code to finish new printer support with OS/2 printing subsystem. |
10 | | |
11 | | If You wish to print from GSView You'll need to need to make some changes in gsview printer.ini file. I'm not familar with it's grammar, so for my printer I simply add line in [Devices] section: |
12 | | |
13 | | alc1900=1200x1200,600x600,300x300 |
14 | | |
15 | | I also create a new printer object with IBM NULL printer driver. May be there is no need to do this as GS send data to printer queue in raw mode? Now I'm capable to print pdf and ps files from GSView. To finish printer support to other OS/2 application I installed fake printer object which generate ps file. Now I print to this fake printer and it generate ps file. After that I simply print this ps file from GSView. |
16 | | This may be automated as well, as I'm at the beginning of the whole way |
17 | | |
18 | | Unfortunatelly, I didn't find the universal solution for all aplication. For example, I use ScenicSoft postscript color printer driver (imported with PPD file) in 2400 resolution for printing from OpenOffice and Xerox 4900 postscript printer driver for printing from Mozilla (works fine only in 300dpi mode :\ ) |
19 | | |
20 | | What's the next? |
21 | | |
22 | | I can add the same way most of HP printers support. It operate slightly different - via separate application named ijs server. I already built the server itself, so everything depend on your backward requests :) |
23 | | |
24 | | -- |
25 | | Best regards. |
26 | | Dmitry. |
27 | | |
28 | | == Additional Remarks == |
29 | | |
30 | | The additional Epson printers listed above are now (as of version 9.00) included in Paul Smedley's distribution of GhostScript. |
31 | | |
32 | | It's possible to send the print job directly from the application --> GhostScript --> printer without having to go through the intermediate stage of running GSView. This is made possible using the new [http://svn.netlabs.org/unipdr UNI.PDR] universal port driver: |
| 1 | == Ghostscript Raster Printing (a.k.a. Using Ghostscript as a Printer Driver) === |
| 2 | |
| 3 | Ghostscript includes a not-insignificant number of built-in printer drivers, many of which are not otherwise supported by OS/2 or CUPS. |
| 4 | |
| 5 | Normally, the way CUPS supports such printers is by calling a program called foomatic-rip which validates the incoming postscript print job, adds some extra options to it, and then calls Ghostscript with the predetermined parameters. Unfortunately, this doesn't currently work under OS/2 because foomatic-rip seems to dislike the postscript data generated by the OS/2 printer drivers (ECUPS.DRV, PSCRIPT.DRV, etc). |
| 6 | |
| 7 | However, there is a way to print seamlessly to Ghostscript-supported printers, if some special configuration is used. Doing it this way bypasses foomatic-rip (and, strictly speaking, CUPS itself) entirely. |
| 8 | |
| 9 | Most of the discussion below focuses on the printers in the Epson driver collection for Ghostscript, but it should work equally well for any built-in Ghostscript printer driver. |
| 10 | |
| 11 | == Basic Procedure == |
| 12 | |
| 13 | The Epson Ghostscript drivers discussed by Dmitry (below) are now included in Paul Smedley's distribution of GhostScript, as of version 9.00, and also as an update to version 8.71 (included in the WPI distribution). |
| 14 | |
| 15 | This technique describes how to send the print job directly from the application --> GhostScript --> printer without having to go through the intermediate stage of running GSView. Basically, this is made possible using the new [http://svn.netlabs.org/unipdr UNI.PDR] universal port driver: |
93 | | (''Don't'' try to print through CUPS -- i.e. with cupslpr -- using this technique, because the job will already be in printer-specific format at that point; CUPS expects to receive PostScript input, and will choke as a result. In any case, you're presumably using this technique because printing via CUPS doesn't work in the first place.) |
94 | | |
95 | | It may also be possible to print to a local (LPT/COM/USB) printer using the OS/2 'print' command or somesuch program, but I haven't tried this. |
96 | | |
97 | | Of course, you can also use the above script to print a pre-existing PostScript file from the command line. |
98 | | |
99 | | -- Added by Alex Taylor |
| 78 | === Printing to a Local Parallel or Serial Attached Printer === |
| 79 | |
| 80 | It's presumably possible to print to a local (LPT/COM) printer using the OS/2 'print' command via the following script, but this has ''not'' been tested. |
| 81 | {{{ |
| 82 | /* GS2PORT.CMD - print to a parallel/serial attached printer through |
| 83 | * GhostScript, using PRINT. |
| 84 | * |
| 85 | * The top-level GhostScript directory should be set in the environment |
| 86 | * variable GHOSTSCRIPT (or just edit the path directly in the file, below). |
| 87 | * |
| 88 | * Syntax: GS2PORT <model> <port> %file% |
| 89 | */ |
| 90 | PARSE ARG model port jobfile |
| 91 | IF jobfile == '' THEN RETURN 1 |
| 92 | |
| 93 | logdir = VALUE('LOGFILES',,'OS2ENVIRONMENT') |
| 94 | tmpdir = VALUE('TMP',,'OS2ENVIRONMENT') |
| 95 | gspath = VALUE('GHOSTSCRIPT',,'OS2ENVIRONMENT') |
| 96 | IF gspath == '' THEN gspath = 'f:\gs\gs8.71' |
| 97 | |
| 98 | IF logdir == '' THEN logdir = tmpdir |
| 99 | logfile = logdir'\gs2port.log' |
| 100 | tmpfile = SysTempFileName( tmpdir'\GS_?????.TMP', '?') |
| 101 | |
| 102 | gscmd = gspath'\bin\gsos2.exe -sDEVICE='model '-dBATCH -dNOPAUSE -sOUTPUTFILE='tmpfile' -q' jobfile |
| 103 | lprcmd = 'print' tmpfile '/D:'port |
| 104 | |
| 105 | '@echo off' |
| 106 | IF STREAM( logfile, 'C', 'QUERY EXISTS') <> '' THEN CALL SysFileDelete logfile |
| 107 | CALL LINEOUT logfile, 'Running GhostScript with command line' gscmd |
| 108 | CALL LINEOUT logfile |
| 109 | ADDRESS CMD gscmd '2>&1 >>'logfile |
| 110 | CALL LINEOUT logfile, 'Return code:' rc |
| 111 | CALL LINEOUT logfile, '' |
| 112 | |
| 113 | CALL LINEOUT logfile, 'Printing job with command line' lprcmd |
| 114 | CALL LINEOUT logfile |
| 115 | ADDRESS CMD lprcmd '2>&1 >>' logfile |
| 116 | CALL LINEOUT logfile, 'Return code:' rc |
| 117 | CALL LINEOUT logfile, '' |
| 118 | |
| 119 | CALL SysFileDelete tmpfile |
| 120 | |
| 121 | RETURN 0 |
| 122 | }}} |
| 123 | |
| 124 | In this case the UNI port settings for a printer on LPT1 would be: |
| 125 | * '''Path and file:''' {{{cmd.exe}}} |
| 126 | * '''Parameters:''' {{{/c c:\os2\gs2port.cmd lp9400 lpt1 %file%}}} |
| 127 | |
| 128 | |
| 129 | === Printing to a Local USB Attached Printer === |
| 130 | |
| 131 | Unfortunately, the OS/2 "print" command doesn't work with USB ports. The only solution which I've found that works with USB printers is the following, rather convoluted procedure. |
| 132 | |
| 133 | First of all, the UNI port settings for the printer object look something like: |
| 134 | * '''Path and file:''' {{{cmd.exe}}} |
| 135 | * '''Parameters:''' {{{/c c:\os2\gs2q.cmd lp9400 LP-9400-Raw %file%}}} |
| 136 | |
| 137 | Next, it's necessary to create a ''second'' printer object (in this example called "LP-9400-Raw") which prints to the actual USB port. However, this second printer must use the IBMNULL printer driver with the spool file format set to PM_Q_RAW. |
| 138 | |
| 139 | The script in this case looks like: |
| 140 | {{{ |
| 141 | /* GS2Q.CMD - print to an IBMNULL print queue using GhostScript. This |
| 142 | * requires VROBJ.DLL to be installed. |
| 143 | * |
| 144 | * The top-level GhostScript directory should be set in the environment |
| 145 | * variable GHOSTSCRIPT (or just edit the path directly in the file, below). |
| 146 | * |
| 147 | * Syntax: GS2Q <model> <port> %file% |
| 148 | */ |
| 149 | CALL RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs' |
| 150 | CALL SysLoadFuncs |
| 151 | CALL RxFuncAdd 'VRPrintFile', 'VROBJ.DLL', 'VRPrintFile' |
| 152 | CALL RxFuncAdd 'VRError', 'VROBJ.DLL', 'VRError' |
| 153 | |
| 154 | PARSE ARG model printer jobfile |
| 155 | IF jobfile == '' THEN RETURN 1 |
| 156 | |
| 157 | logdir = VALUE('LOGFILES',,'OS2ENVIRONMENT') |
| 158 | tmpdir = VALUE('TMP',,'OS2ENVIRONMENT') |
| 159 | gspath = VALUE('GHOSTSCRIPT',,'OS2ENVIRONMENT') |
| 160 | IF gspath == '' THEN gspath = 'f:\gs\gs8.71' |
| 161 | |
| 162 | IF logdir == '' THEN logdir = tmpdir |
| 163 | logfile = logdir'\gs2q.log' |
| 164 | tmpfile = SysTempFileName( tmpdir'\GS_?????.TMP', '?') |
| 165 | |
| 166 | gscmd = gspath'\bin\gsos2.exe -sDEVICE='model '-dBATCH -dNOPAUSE -sOUTPUTFILE='tmpfile' -q' jobfile |
| 167 | |
| 168 | '@echo off' |
| 169 | IF STREAM( logfile, 'C', 'QUERY EXISTS') <> '' THEN CALL SysFileDelete logfile |
| 170 | CALL LINEOUT logfile, 'Running GhostScript with command line' gscmd |
| 171 | CALL LINEOUT logfile |
| 172 | ADDRESS CMD gscmd '2>&1 >>'logfile |
| 173 | CALL LINEOUT logfile, 'Return code:' rc |
| 174 | CALL LINEOUT logfile, '' |
| 175 | |
| 176 | CALL LINEOUT logfile, 'Now sending file to printer' printer |
| 177 | rc = VRPrintFile( printer, tmpfile ) |
| 178 | CALL LINEOUT logfile, 'Return code:' rc |
| 179 | IF rc == 0 THEN |
| 180 | call lineout logfile, VRError() |
| 181 | CALL LINEOUT logfile, '' |
| 182 | |
| 183 | CALL SysFileDelete tmpfile |
| 184 | |
| 185 | RETURN 0 |
| 186 | }}} |
| 187 | |
| 188 | This seems to work here, although I had problems until I made sure to use Ghostscript 8.71 (instead of 9.x). It also appears to be very important that the "default spool file type" in the IBMNULL printer driver properties is set to use PM_Q_RAW (and ''not'' PM_Q_STD). |
| 189 | |
| 190 | Note that this script as shown doesn't accept blanks in the printer name, so you should name your IBMNULL printer accordingly. |
| 191 | |
| 192 | |
| 193 | == Additional Remarks == |
| 194 | |
| 195 | (''Don't'' try to print through CUPS -- i.e. with cupslpr -- using this technique, because the job will already be in printer-specific format at that point; CUPS expects to receive Postscript input, and will choke as a result. In any case, you're presumably using this technique because printing via CUPS doesn't work in the first place.) |
| 196 | |
| 197 | == Original Note == |
| 198 | |
| 199 | The original posting from Dmitry Froloff follows. This is mainly for historical interest now. |
| 200 | |
| 201 | ===== List of newly supported Epson printers: ===== |
| 202 | |
| 203 | epl2050 epl2050p epl2120 epl2500 epl2750 epl5800 epl5900 epl6100 epl6200 lp1800 lp1900 lp2200 lp2400 lp2500 lp7500 lp7700 lp7900 lp8100 lp8300f lp8400f lp8600 lp8600f lp8700 lp8900 lp9000b lp9100 lp9200b lp9300 lp9400 lp9600 lp9600s alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 lp3000c lp8000c lp8200c lp8300c lp8500c lp8800c lp9000c lp9200c lp9500c lp9800c |
| 204 | |
| 205 | Why I made this build. |
| 206 | |
| 207 | Our company bought Epson AcuLaser C1900 color printer. This model is capable to work PCL5 mode but in B/W mode only and doesn't understand poscript., while I wish to print in color too. So I look for solution and found out that Epson sources are GPL now and exist as GS patch. |
| 208 | |
| 209 | So I downloaded the latest GS (8.53 at the moment) and the latest Epson GS patch ghostscript-7.07.tar.bz2. I applied the patch (patched sources GS doesn't changed too much from 7.07 to 8.53 version) and built the modules with gcc 3.3.5, what mean that you need lib06 dll (you may take it here ). I also made some minor changes in main GS code to finish new printer support with OS/2 printing subsystem. |
| 210 | |
| 211 | If You wish to print from GSView You'll need to need to make some changes in gsview printer.ini file. I'm not familar with it's grammar, so for my printer I simply add line in [Devices] section: |
| 212 | |
| 213 | alc1900=1200x1200,600x600,300x300 |
| 214 | |
| 215 | I also create a new printer object with IBM NULL printer driver. May be there is no need to do this as GS send data to printer queue in raw mode? Now I'm capable to print pdf and ps files from GSView. To finish printer support to other OS/2 application I installed fake printer object which generate ps file. Now I print to this fake printer and it generate ps file. After that I simply print this ps file from GSView. |
| 216 | This may be automated as well, as I'm at the beginning of the whole way |
| 217 | |
| 218 | Unfortunatelly, I didn't find the universal solution for all aplication. For example, I use ScenicSoft postscript color printer driver (imported with PPD file) in 2400 resolution for printing from OpenOffice and Xerox 4900 postscript printer driver for printing from Mozilla (works fine only in 300dpi mode :\ ) |
| 219 | |
| 220 | What's the next? |
| 221 | |
| 222 | I can add the same way most of HP printers support. It operate slightly different - via separate application named ijs server. I already built the server itself, so everything depend on your backward requests :) |
| 223 | |
| 224 | -- |
| 225 | Best regards. |
| 226 | Dmitry. |
| 227 | |