ftp.nice.ch/peanuts/GeneralData/Usenet/news/1991/CSNSys-91.tar.gz#/comp-sys-next-sysadmin/1991/Sep/How-to-print-a-postscript-file-?

This is How-to-print-a-postscript-file-? in view mode; [Up]


Date: Sun 28-Sep-1991 22:01:54 From: beaucham@uxh.cso.uiuc.edu (James Beauchamp) Subject: How to print a postscript file ? I have a Postscript file created by a PC application (ChiWriter) which I transferred to the NeXT. I want to print it on the NeXT Laser Printer. Preview doesn't like it and says it isn't Postscript. I have two questions: 1) What is wrong with this file? 2) How can I fix it? 3) Is there a way to print a Postscript file directly with a Unix command without using Preview or some other similar application? Below are the first 100 lines of my 937 line Postscript file followed by all 42 lines of error messages produced by Preview. If anyone is willing to see all 937 lines of the Postscript file, I'll be happy to send it to them. I didn't want to clog the news system. Jim Beauchamp *************************************** start ps file %% Copyright (C) 1987..90 Horstmann Software Design Corp. All Rights Reserved. %% %% Vector for extended characters (with ASCII codes >127) /Extvect [ 167 /section 169 /Ccedilla 172 /udieresis 173 /eacute 174 /acircumflex 175 /adieresis 176 /agrave 254 /aring 181 /ccedilla 205 /ecircumflex 184 /edieresis 185 /egrave 188 /idieresis 189 /icircumflex 190 /igrave 192 /Adieresis 201 /Aring 204 /Eacute 241 /ae 225 /AE 208 /ocircumflex 209 /odieresis 210 /ograve 211 /ucircumflex 212 /ugrave 213 /ydieresis 214 /Odieresis 215 /Udieresis 249 /oslash 163 /sterling 233 /Oslash 251 /germandbls 187 /guillemotright 216 /aacute 217 /iacute 218 /oacute 219 /uacute 220 /ntilde 221 /Ntilde 168 /currency 202 /ring 191 /questiondown 161 /exclamdown 222 /Aacute 224 /Acircumflex 223 /Agrave 252 /atilde 253 /Atilde 228 /Edieresis 227 /Ecircumflex 226 /Egrave 230 /Idieresis 231 /Iacute 229 /Icircumflex 235 /Igrave 236 /Oacute 238 /Ocircumflex 237 /Ograve 243 /otilde 244 /Otilde 242 /Uacute 240 /Ucircumflex 239 /Ugrave 246 /Ydieresis ] def /changedict 12 dict def /ChangeVector { changedict begin /newCodesAndNames exch def /newFontName exch def /baseFontName exch def /baseFontDict baseFontName findfont def /newFont baseFontDict maxlength dict def baseFontDict { exch dup /FID ne { dup /Encoding eq { exch dup length array copy newFont 3 1 roll put } { exch newFont 3 1 roll put } ifelse } { pop pop } ifelse } forall newFont /FontName newFontName put newCodesAndNames aload pop newCodesAndNames length 2 idiv { newFont /Encoding get 3 1 roll put } repeat ********************************************end ps, start error messages DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: undefined; OffendingCommand: def9 ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: dict ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: begin ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: dictstackunderflow; OffendingCommand: end ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: get ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: undefined; OffendingCommand: def9 ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: dict ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: begin ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: dictstackunderflow; OffendingCommand: end ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: get ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: undefined; OffendingCommand: def9 ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: dict ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: begin ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: dictstackunderflow; OffendingCommand: end ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: get ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: undefined; OffendingCommand: def9 ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: dict ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: begin ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: dictstackunderflow; OffendingCommand: end ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: typecheck; OffendingCommand: get ]%% DPS client library error: PostScript program error, DPSContext 19f24 %%[ Error: undefined; OffendingCommand: defTopLtHelv ]%%
Date: Sun 29-Sep-1991 11:58:49 From: at626@cleveland.Freenet.Edu (Dave Strout) Subject: Re: How to print a postscript file ? Just say cat fname.ps | lpr. That will often print cheesy PS that preview pukes on. Also, try YAP, as it is slightly more forgiving.
Date: Sun 29-Sep-1991 19:10:54 From: beaucham@uxh.cso.uiuc.edu (James Beauchamp) Subject: Re: How to print a postscript file ? I've seen several replies for my quest for help in printing a PC-originated "postscript" file. These notes contain helpful hints, but "no cigar" so far. Here is a summary so far: Mike Friedel suggested that the header %!PS-Adobe-2.0 is needed, whereas Alan Drew says >The first line of a PostScript program should allways be '%!'. I tried both. Maybe they are necessary, but they aren't sufficient. Anyway, for good measure I am leaving '%!' as the first line of the file. For actually printing a postscript file, suggestions ranged from lpr <file> to lp <file> to cat <file> | lpr I don't think the command lp exists, but I use lpr all the time. Funny that 'man lpr' doesn't bother to mention that you can print a postscript file with it, although it gives flags for several other types of files. Anyway, I tried all of these, and, like, Preview, it gives an error message, and then nothing happens. It is expecting PostScript, however, so I guess the '%!' is the flag that throws it into PostScript mode. The error message looks like: PostScript error:%%[[Error:undefined; OffendingCommand: def 9]%% It turned out that there were some def^D9 's in the file, so turned them into just 'def'. Then the error message became: PostScript error: %%[Error:stackunderflow; OffendingCommand: dict]%% Dave Strout says: >Also, try YAP, as it is slightly more forgiving. I could not find the program YAP on my NeXT. Where is it? Mike Friedel also said: >Things to watch out for. >1.) Character encoding differs from machines and fonts. >2.) Make sure the postscript doesn't refernce any fonts that > do not exist on the NeXT. >3.) Not all postscript is equal, exspecially that generated by > a PC. Biggest problem is usually textformatig, illegal > characters in the code. This could be the answer. The file is supposed to define its own fonts, as the actual text was preceded by a "download process" which dumps font defs into the same file. lpr may be barphing on these font definitions. I looked for illegal characters, but found only 4 offending ^D's, mentioned above, but that didn't solve the problem. Below is the section of code which I believe contains the font definitions. Do you see anything in this code which could cause problems? Any is there an easy way around the difficulty? Jim Beauchamp beaucham@uxh.cso.uiuc.edu ********************************************begin ps code fragment %% set up the font-switching procedures %% /Symbol /SY-12 12 RoundWidths /Sy { /SY-12 findfont 12 Scale mul scalefont setfont } bind def /Cm { /Courier-Bold findfont [10 Scale mul 0 0 12 Scale mul 0 0] makefont setfont } bind def /PicaAndElite { %% Make all the Ext versions %% /Courier /Courier-Ext Extvect ChangeVector /Courier-Oblique /Courier-Oblique-Ext Extvect ChangeVector /Courier-Bold /Courier-Bold-Ext Extvect ChangeVector /Sm { /Courier-Ext findfont 8 Scale mul scalefont setfont } bind def } def /Elite { PicaAndElite /St { /Courier-Ext findfont 10 Scale mul scalefont setfont } bind def /It { /Courier-Oblique-Ext findfont 10 Scale mul scalefont setfont } bind def /Bd { /Courier-Bold-Ext findfont 10 Scale mul scalefont setfont } bind def /Or { /Courier-Bold-Ext findfont [10 Scale mul 0 0 12 Scale mul 0 0] makefont setfont } bind def } def /Pica { PicaAndElite /St { /Courier-Ext findfont 12 Scale mul scalefont setfont } bind def /It { /Courier-Oblique-Ext findfont 12 Scale mul scalefont setfont } bind def /Bd { /Courier-Bold-Ext findfont 12 Scale mul scalefont setfont } bind def /Or { /Courier-Bold-Ext findfont [12 Scale mul 0 0 16 Scale mul 0 0] makefont setfont } bind def } def /Prop { %% Make all the Ext versions %% /Times-Roman /Times-Roman-Ext Extvect ChangeVector /Times-Italic /Times-Italic-Ext Extvect ChangeVector /Times-Bold /Times-Bold-Ext Extvect ChangeVector /Times-Roman-Ext /TR-12 12 RoundWidths /Times-Roman-Ext /TR-8 8 RoundWidths /Times-Italic-Ext /TI-12 12 RoundWidths /Times-Bold-Ext /TB-12 12 RoundWidths /St { /TR-12 findfont 12 Scale mul scalefont setfont } bind def /Sm { /TR-8 findfont 8 Scale mul scalefont setfont } bind def /It { /TI-12 findfont 12 Scale mul scalefont setfont } bind def /Bd { /TB-12 findfont 12 Scale mul scalefont setfont } bind def /Or { /TB-12 findfont [12 Scale mul 0 0 16 Scale mul 0 0] makefont setfont } bind def } def /Helv { /Helvetica /Helvetica-Ext Extvect ChangeVector /Helvetica-Oblique /Helvetica-Oblique-Ext Extvect ChangeVector /Helvetica-Bold /Helvetica-Bold-Ext Extvect ChangeVector /Helvetica-Ext /HV-12 12 RoundWidths /Helvetica-Ext /HV-8 8 RoundWidths /Helvetica-Oblique-Ext /HO-12 12 RoundWidths /Helvetica-Bold-Ext /HB-12 12 RoundWidths /St { /HV-12 findfont 12 Scale mul scalefont setfont } bind def /Sm { /HV-8 findfont 8 Scale mul scalefont setfont } bind def /It { /HO-12 findfont 12 Scale mul scalefont setfont } bind def /Bd { /HB-12 findfont 12 Scale mul scalefont setfont } bind def /Or { /HB-12 findfont [12 Scale mul 0 0 16 Scale mul 0 0] makefont setfont } bind def /Cm { /Courier-Bold findfont [12 Scale mul 0 0 14 Scale mul 0 0] makefont setfont } bind def } def

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.