next up previous
Next: How do I get Up: Encapsulated PostScript Previous: What are EPSI and

How do I convert PostScript to EPS?

Use pstoepsi, or do it by hand. GhostScript's program ps2epsi does this also, as does LaserWriter 8 for the Mac. GhostScript on the Mac can output EPS also, I believe.

To convert from PostScript to EPS, one must guarantee that the PostScript file meets the above requirements. If the actual program conforms to the programming requirements, then one can simply add the required comments at the top of the file saying that the file is EPS and giving its BoundingBox dimensions.

Optional comments include font usage (%%DocumentFonts: or %%DocumentNeededResources: font), EPSI preview comments (%%Begin(End)Preview:) extensions (%%Extensions:) and language level (%%LanguageLevel:).

There are some operators that should not be used within an EPS file:

        banddevice     cleardictstack   copypage     erasepage
        exitserver     framedevice      grestoreall  initclip
        initgraphics   initmatrix       quit         renderbands
        setglobal      setpagedevice    setshared    startjob

These also include operators from statusdict and userdict operators like legal, letter, a4, b5, etc.

There are some operators that should be carefully used:

        nulldevice     setgstate        sethalftone  setmatrix
        setscreen      settransfer      undefinefont

To convert a PostScript file to EPS format, you must edit the file using a text editor or word processor to add lines that will define the file as an EPS-format file.

1.
Using your normal method of printing, print the PostScript file to a PostScript printer. You can choose to view it on the screen instead, but keep in mind that all the below distance measurements assume that you are printing on a normal-sized piece of paper. NOTE: If the PostScript image does not get displayed properly, it probably will not work either once you have converted it to EPS format. Correct the PostScript program so that it works before you convert it to EPS format.

2.
Use a tool (see below) to find the bounding box, which shows how much space the PostScript image occupies when printed. You specify the dimensions of the bounding box when you convert the PostScript file to EPS format.

3.
If you don't have a bounding box tool, you can just use a ruler and draw one on your printout. With two horizontal lines and two vertical lines, draw a box around the image that includes the entire image while minimizing white space.

This box represents your bounding box. You may want to leave a small amount of white space around the image as a precautionary measure against minor printing problems, such as paper stretching and paper skewing.

4.
Measure distance ``a'' from the lower-left corner of the image to the left edge of the paper.

5.
Write the measurement in points. If your ruler does not show points, calculate the total number of points: 1 inch = 72 points, 1 cm = 28.3 points, and 1 pica = 12 points. Designate this measurement as ``measurement a.''

6.
Measure distance ``b'' from the lower-left corner of the image to the bottom edge of the paper.

Designate this measurement in points as ``measurement b.''

7.
Measure distance ``c'' from the upper-right corner of the image to the left edge of the paper.

Designate this measurement in points as ``measurement c.''

8.
Measure distance ``d' from the upper-right corner of the image to the bottom edge of the paper.

Designate this measurement in points as ``measurement d.''

9.
Using any text editor, open the PostScript file for editing.

You'll see several lines of text. These lines are the PostScript description of the image. The lines at the top of the file are the header.

10.
Add these lines to, or modify existing lines in, the header (the first group of lines in any PostScript file):

	%!PS-Adobe-2.0 EPSF-2.0
	%%Creator: name
	%%CreationDate: date
	%%Title: filename
	%%BoundingBox: a b c d

Note: Make sure that the first line in the file is ``%!PS-Adobe-2.0-EPSF-2.0''. Also, do not separate the header lines with a blank line space. The first blank line that PostScript encounters tells it that the the next line begins the body of the program.

For ``name,'' type your name or initials. For ``date,'' type today's date using any format (for example, MM-DD-YY, MM/DD/YY, July 5, 1987, and so on). For ``filename,'' type the name of the PostScript file. After ``BoundingBox: ,'' type the measurements you took in steps 3, 4, 5, and 6, separating each with a space: ``a'' is the measurement from Step 3, ``b'' is the measurement from Step 4, ``c'' is the measurement from Step 5, and ``d'' is the measurement from Step 6.

11.
Save the file in text-only format.

If you are interested in learning how to further edit your PostScript files, these books are available at most bookstores:

Understanding PostScript Programming and the green book.

The Document Structuring Conventions (DSC), version 1.0, are discussed in Appendix C of the old red book. The new red book has a lot of information about Encapsulated PostScript.

There will be a technical note available from Adobe called ``Guidelines for Specific Operators'' that will talk about why some operators are prohibited and how to use the others.


next up previous
Next: How do I get Up: Encapsulated PostScript Previous: What are EPSI and
Allen B
2/2/1998