🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #166

Re: Need an intelligent Ascii - PS Filter

#166
From: Chris Lewis
Date: Sat, 01 Aug 1992 19:42
27 lines
1898 bytes
In article <1992Aug1.045437.1616@thunder.mcrcim.mcgill.edu> bruno@thunder.mcrcim.mcgill.edu (Bruno Hall) writes:
>gry84@psi.sci.sdl.usu.edu (Martin H. Jones) writes:
>>	I have been looking for a filter (the printcap type) that will convert
>>ascii to postscript and leave postscript alone.

>So what's needed is some manner of differentiation between the two.
>IF (note big if) your word processor is outputting ps which abides by
>the Adobe document structuring conventions, then you could check out
>the first 11 characters of the file (which will be "%!PS-Adobe-").

While things that are DSC compliant will lead off with %!PS-Adobe-, you're
being much too strict.  By convention, PostScript always starts with
%!.  So if the file starts with %!, you can assume it to be PostScript.
Regardless of whether the file claims to be DSC compliant or not.

Almost all applications use this convention.  Though, there are some stupid
broken ones.  Ie: WP apparently leads files with <control-D>%!.

PSxlate (in psroff 3.0) supports these magic cookies, and will pass
PostScript thru unscathed, but will convert ASCII to PostScript.
It also has lots of other facilities, like page flipping etc.

I imagine psutils has the same sort of facilities.
-- 
Chris Lewis; clewis@ferret.ocunix.on.ca; Phone: Canada 613 832-0541
Psroff 3.0 info: psroff-request@ferret.ocunix.on.ca
Ferret list: ferret-request@ferret.ocunix.on.ca
Technical Details
Message-ID: <3668@ecicrl.ocunix.on.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!cunews!revcan!ecicrl!clewis
References: <1992Jul31.121222.57722@cc.usu.edu> <1992Aug1.045437.1616@thunder.mcrcim.mcgill.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!cunews!revcan!ecicrl!clewis
From: clewis@ferret.ocunix.on.ca (Chris Lewis)
Newsgroups: comp.lang.postscript
Subject: Re: Need an intelligent Ascii - PS Filter
Keywords: Filter
Message-ID: <3668@ecicrl.ocunix.on.ca>
Date: 1 Aug 92 19:42:35 GMT
References: <1992Jul31.121222.57722@cc.usu.edu> <1992Aug1.045437.1616@thunder.mcrcim.mcgill.edu>
Organization: Elegant Communications Inc., Ottawa, Canada
Lines: 27