[comp.lang.postscript] PostScript headers

colemanm@cheops.qld.tne.oz.au (Mark Coleman) (06/11/91)

I'm sorry if this is yaFAQ but I don't normally frequent this group.

I'd like to know what is the absolute definitive way to recognise a
Postscript file.

I'm currently using the following method in my interface script under UN*X

head -3 /tmp/$$ | grep %!

It seems to be the only way that does work all the time.
Although I thought that when the previous interface script I wrote used to
look for a %! as the first 2 chars in the incoming file but of course 
Micros*ft Word for Windows stuffed it because it sends a cntrl-D at the
start of the file.

Any pointers would be appreciated.....MarkC.....

-- 
Mark Coleman                   O   O   EMAIL: colemanm@cheops.qld.tne.oz.au
Telecom Australia                |     FAX:   +61 7 837 4704
TNE Computer Support Services  *****   PH:    +61 7 837 3143
Brisbane, Queensland. OZ       \===/   "You'll find these are my opinions alone"

carl@iago.caltech.edu (Lydick, Carl) (06/11/91)

In article <1991Jun11.092741.27041@cheops.qld.tne.oz.au>, colemanm@cheops.qld.tne.oz.au (Mark Coleman) writes...
>I'm sorry if this is a FAQ but I don't normally frequent this group.
> 
>I'd like to know what is the absolute definitive way to recognise a
>Postscript file.

The only "absolute definitive" way to recognize one is to send it to a printer
or other display device that's running Adobe PostScript.  If the printer
accepts it, it was PostScript;  otherwise, it wasn't.
--------------------------------------------------------------------------------
Carl J Lydick	HEPnet/NSI: SOL1::CARL	Internet: CARL@SOL1.GPS.CALTECH.EDU

vsarkela@csc.fi (06/13/91)

In article <1991Jun11.133128.20685@nntp-server.caltech.edu>, 
carl@iago.caltech.edu (Lydick, Carl) writes:
> In article <1991Jun11.092741.27041@cheops.qld.tne.oz.au>, 
colemanm@cheops.qld.tne.oz.au (Mark Coleman) writes...
>>I'm sorry if this is a FAQ but I don't normally frequent this group.
>> 
>>I'd like to know what is the absolute definitive way to recognise a
>>Postscript file.
> 
> The only "absolute definitive" way to recognize one is to send it to a printer
> or other display device that's running Adobe PostScript.  If the printer
> accepts it, it was PostScript;  otherwise, it wasn't.
> --------------------------------------------------------------------------------
> Carl J Lydick	HEPnet/NSI: SOL1::CARL	Internet: CARL@SOL1.GPS.CALTECH.EDU

My experience is, that if you copy a windows 3 postscript file to printer
attached directly to the PC, it works fine.
On the other hand, if you transfer that file to a u*ix machine and try lpr
to print it, nothing happens. I solved this problem with a filter, which
inserts carriage return and line feed after the control-d.

Control-d is required to reset the printer after previous job (it clears
the header, which normally comes with each ps file) and %! must be the 
two first characters after cr lf. I haven't checked out, if ultrix drivers
(filters) or decserver insert something after control-d...

-Vesa Sarkela    Finnish Pulp & Paper Research Institute

rchui@neptune.nswc.navy.mil (Chui) (06/16/91)

I'd like to know what is the absolute definitive way to recognise a
>Postscript file.

The only "absolute definitive" way to recognize one is to send it to a printer
or other display device that's running Adobe PostScript.  If the printer
accepts it, it was PostScript;  otherwise, it wasn't.

	I don't think this is good way to recognize the Postscript file.