🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #692

Re: Garden variety PS -> EPS filter

#692
From: Chung-Pang Lai
Date: Thu, 13 Jul 1989 23:14
72 lines
3340 bytes
In article <11613@orstcs.CS.ORST.EDU> pvo@oce.orst.edu (Paul V O'Neill) writes:
]My boss is using FrameMaker 1.3b on a Sun-3/50 running SunOS 3.5.  She wants
]to import some Postscript figures produced by a locally-written Postscript
]plotting package.  Today she discovered that she can only import Encapsulated
]Postscript.  
]
]Does anyone have, or know of, code, packages, or applications that will 
]convert garden-variety Postscript to Encapsulated Postscript?

And Glenn Reid replied:
] Sometimes you can manually add some of the comments and other syntactic
] sugar to the PostScript file to make it appear to be an Encapsulated
] PostScript file, but EPSF really means more than that.  It means that
] the program promises not to violate certain portability constraints,
] and adding comments doesn't provide that.

This is what I do to make FrameMaker 1.3b to take my PS program as an
EPSF file:	(Disclaimer: this may not work for other software)

1) Find out the bounding box of the output:
If you wrote the PS program, you know the coordinates of the bounding box.
For example, a 1" radius circle centered at (3",5") off the lower left corner
of the page is bounded by a box (2", 4"), (4", 6") where the first pair is
the lower left, and the second pair the upperright corner of the bounding box,
then you get the coordinate of the corners by multipy 72 per inch to get
(144 288 288 432) for the %%BoundingBox

If you did not write the PS file, send the PS to the printer.  Take out a
ruler and measure the bounding box on paper.  Get the value for the
%%BoundingBox as above.

2) change the first line to:
	%!PS-Adobe-2.0 EPSF-1.2

3) Add:
	%%BoundingBox: 144 288 288 432
	%%EndComments
(of course, replace the values with the actual value that you've just
figured out)

At the end of the file add:
	%%Trailer

The circle example above will look like the following:

%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 144 288 288 432
%%EndComments
newpath
216 360 72 0 360 arc
stroke
showpage
%%Trailer

As you can see, there is no Preview Image.  Hence FrameMaker will show
the box in gray (or white?)  You can grab the resize handle to scale
the picture or reposition it.  I'd recommand using the Scale command
and specify a percentage as scaling factor to preserve the aspect
ratio of the picture.  Rubberbanding using the mouse will usually
end up in a flattened or elongated picture.

The showpage can be left in there, FrameMaker redefines showpage as
no-op before printing the EPSF import.

As Glenn has pointed out, faking a EPSF file does not mean you get
a real EPSF file.  But it is worth trying.

-- 
.signature under construction ...
{pyramid, osu-cis, uunet, killer}!daisy!cplai    C.P. Lai
cplai%daisy.UUCP@uunet.UU.NET   cplai%daisy@killer.DALLAS.TX.USA
Daisy Systems Corp, 700B Middlefield Road, Mtn View CA 94039.  (415)960-6961
Technical Details
Message-ID: <3197@daisy.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!decwrl!sgi!daisy!cplai
References: <11613@orstcs.CS.ORST.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!decwrl!sgi!daisy!cplai
From: cplai@daisy.UUCP (Chung-Pang Lai)
Newsgroups: comp.lang.postscript
Subject: Re: Garden variety PS -> EPS filter
Message-ID: <3197@daisy.UUCP>
Date: 13 Jul 89 23:14:18 GMT
References: <11613@orstcs.CS.ORST.EDU>
Reply-To: cplai@daisy.UUCP (Chung-Pang Lai)
Organization: Daisy/Cadnetix Corp., Mtn. View, CA
Lines: 72