[comp.text.tex] Encapsulated postscript from postscript

dfk@grad13.cs.duke.edu (David F. Kotz) (08/02/90)

Is there a program that will convert a generic postscript file into an
"encapsulated" postscript file (EPSF)?  I have dvips 4.21, which
supports inclusion of EPSF files into latex documents, but have many
tools which do not generate encapsulated postscript.

I do not read all of these groups, so please reply with email.

Thanks in advance,

David Kotz
Department of Computer Science, Duke University, Durham, NC 27706 USA
ARPA:	dfk@cs.duke.edu
CSNET:	dfk@duke        
UUCP:	decvax!duke!dfk

mark@DRD.Com (Mark Lawrence) (08/03/90)

dfk@grad13.cs.duke.edu (David F. Kotz) wrote:
} Is there a program that will convert a generic postscript file into an
} "encapsulated" postscript file (EPSF)?  

This question comes up all the time on the framers newsgroup.  Paul
O'Neill out at Oregon State has a standard answer:

Date: Sat, 16 Jun 90 01:56:28 PDT
From: pvo@sapphire.oce.orst.edu (Paul O'Neill)
To: framers@DRD.Com
Subject: Summary (Re:  More on EPSF from C.P.Lai)

I started that discussion a year ago.  I might as well use this opportunity
to summarize what I've learned about it in the last year.

Two lines are usually enough to fake the PS -> EPSF conversion

1) Start the postscript file with the line:
		%!PS-Adobe-2.0 EPSF-1.2

2) Include a BoundingBox: line, eg:
		%%BoundingBox: 0 0 504 378

3) For framemaker, IMPORT, do not INCLUDE the fake EPSF file.

This works for all NeXT apps requiring EPSF (including Frame2.0) and 
Frame1.3 on Sun's.  (On the Next, the file is interpreted and you get
to see it!).

To calculate the BB,

	bbfig by Ned Batchelder sometimes works.
	  [rtsg.ee.lbl.gov:dvi2ps.tar.Z]

	distill by Glenn Read usually works.
	  [comp.lang.postscript about a year ago,  maybe Adobe fileserver?]

	printing the file and measuring with a ruler always works.

	For images:
		Patch fbps to do 1) and 2)  (patch included, below)
		  [nl.cs.cmu.edu:/usr/mlm/ftp/fbm.tar.Z]

	For Unix plot(5) graphs:
		Use plot2ps instead of psplot.
		  [comp.sources.misc <seindal@diku.dk (Rene' Seindal)> v06i083]


Paul O'Neill                 pvo@oce.orst.edu
Coastal Imaging Lab
OSU--Oceanography
Corvallis, OR  97331         503-737-3251


*** fbps.c.orig	Sat Aug 26 09:01:28 1989
--- fbps.c	Thu Jan 11 21:05:53 1990
***************
*** 52,57 ****
--- 52,58 ----
  char *argv[];
  { register int i, j;
    int rows, cols, rowlen;
+   int bbx, bby;
    double paperwidth, paperheight;
    double maxwidth, maxheight;
    double width = -1, height, llx, lly;
***************
*** 139,145 ****
  
    /* Write out PostScript Header */
    if (scribe)
!   { printf ("%%! Scribe @graphic style PostScript\n");
      if (title) { printf ("%%%%Title: %s\n", ps_chars (title)); }
      if (creator) { printf ("%%%%Creator:  %s\n", ps_chars (creator)); }
      printf ("%%%%CreationDate: %s", ctime (&clock));
--- 140,149 ----
  
    /* Write out PostScript Header */
    if (scribe)
!   { printf ("%%!PS-Adobe-2.0 EPSF-1.2\n");
!     bbx = width * 72;
!     bby = height * 72;
!     printf ("%%%%BoundingBox: 0 0 %d %d\n", bbx, bby);
      if (title) { printf ("%%%%Title: %s\n", ps_chars (title)); }
      if (creator) { printf ("%%%%Creator:  %s\n", ps_chars (creator)); }
      printf ("%%%%CreationDate: %s", ctime (&clock));

mark@DRD.Com (Mark Lawrence) (08/03/90)

mark@drd.Com (Mark Lawrence) wrote:
} This question comes up all the time on the framers newsgroup.  
                                                     ^^^^^^^^^
gads, too late in the day.  I *meant* mailing-list.