| 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 UniPdr] universal port driver: |
| 33 | |
| 34 | * Install UNI.PDR (to \OS2\DLL) |
| 35 | * Create a new port of type UNI. |
| 36 | * Edit the port properties. We need to send the print job through two programs: GhostScript, followed by whatever command actually sends the job to the printer. Unfortunately, UniPdr doesn't seem to support piping the job through multiple programs, so you have to write a REXX script (or something similar) which does the work. |
| 37 | |
| 38 | I've used the following script to print to a TCP/IP (LPD) printer on the network: |
| 39 | |
| 40 | {{{ |
| 41 | /* GS2LPR.CMD - print to a TCP/IP printer through GhostScript, using LPR. |
| 42 | * The top-level GhostScript directory should be set in the environment |
| 43 | * variable GHOSTSCRIPT (or just edit the path directly in the file, below). |
| 44 | * Syntax: GS2LPR <model> <LPD server> <LPD printer> %file% |
| 45 | */ |
| 46 | PARSE ARG model server printer jobfile |
| 47 | IF jobfile == '' THEN RETURN 1 |
| 48 | |
| 49 | logdir = VALUE('LOGFILES',,'OS2ENVIRONMENT') |
| 50 | tmpdir = VALUE('TMP',,'OS2ENVIRONMENT') |
| 51 | gspath = VALUE('GHOSTSCRIPT',,'OS2ENVIRONMENT') |
| 52 | IF gspath == '' THEN gspath = 'f:\gs\gs9.00' |
| 53 | |
| 54 | IF logdir == '' THEN logdir = tmpdir |
| 55 | logfile = logdir'\gs2lpr.log' |
| 56 | tmpfile = SysTempFileName( tmpdir'\GS_?????.TMP', '?') |
| 57 | |
| 58 | gscmd = gspath'\bin\gsos2.exe -sDEVICE='model '-dBATCH -dNOPAUSE -sOUTPUTFILE='tmpfile' -q' jobfile |
| 59 | lprcmd = 'lpr.exe -a 0 -b -s' server '-p' printer tmpfile |
| 60 | |
| 61 | '@echo off' |
| 62 | IF STREAM( logfile, 'C', 'QUERY EXISTS') <> '' THEN CALL SysFileDelete logfile |
| 63 | CALL LINEOUT logfile, 'Running GhostScript with command line' gscmd |
| 64 | CALL LINEOUT logfile |
| 65 | ADDRESS CMD gscmd '2>&1 >>'logfile |
| 66 | CALL LINEOUT logfile, 'Return code:' rc |
| 67 | CALL LINEOUT logfile, '' |
| 68 | |
| 69 | CALL LINEOUT logfile, 'Printing job with command line' lprcmd |
| 70 | CALL LINEOUT logfile |
| 71 | ADDRESS CMD lprcmd '2>&1 >>' logfile |
| 72 | CALL LINEOUT logfile, 'Return code:' rc |
| 73 | CALL LINEOUT logfile, '' |
| 74 | |
| 75 | CALL SysFileDelete tmpfile |
| 76 | |
| 77 | RETURN 0 |
| 78 | }}} |
| 79 | |
| 80 | Using the above, the following [http://svn.netlabs.org/unipdr UniLpr] settings will allow printing to a networked LP-9400 printer with TCP/IP address 192.168.1.100: |
| 81 | |
| 82 | * '''Path and file:''' {{{cmd.exe}}} |
| 83 | * '''Parameters:''' {{{/c c:\os2\gs2lpr.cmd lp9400 192.168.1.100 * %file%}}} |
| 84 | |
| 85 | You could presumably print to a Samba printer by using smbspool instead of lpr. |
| 86 | |
| 87 | (''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.) |
| 88 | |
| 89 | 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. |
| 90 | |
| 91 | -- Added by Alex Taylor |