Note
Do not use the
clear
or
cleardictstack
operators to clear the stacks in an
EPS file. These wholesale cleanup operators not only clear the EPS file’s
operands and dictionaries from the stacks, they may clear other objects
as well.
The PostScript dictionary lookup mechanism searches the dictionaries that
are on the dictionary stack. Bypassing the dictionary lookup mechanism for
system-level names is
illegal
in an EPS file.
Do not use the following type
of code:
/S systemdict /showpage get def% Illegal EPS code
It may cause incorrect results in the including application’s PostScript output
by overriding the application’s redefinitions.
2.6
Graphics State
An application importing an EPS file may transform the PostScript coordi-
nate system or alter some other aspect of the graphics state so it is no longer
in its default state. This allows the application to change the appearance of
the EPS file, typically by resizing, clipping, or rotating the illustration. If the
EPS file makes assumptions about the graphics state, such as the current
clipping path, or explicitly sets something it shouldn’t, such as the transfor-
mation matrix (see section section 2.4
), the results may not be what were
expected.
In preparation for including an EPS file, the graphics state must be set by the
including application as follows: current color to black, line caps to square
butt end, line joins to mitered, line width to 1, dash pattern to solid, miter
limit to 10, and current path to an empty path. Also, if printing to a Level 2
interpreter, overprint and stroke adjust should be set to
false
. An EPS file can
assume that this is the default state. It is the responsibility of the application
importing the EPS file to make sure that the graphics state is correctly set.
2.7
Initializing Variables
It is common for PostScript language programs to use short names, such as
x
,
for variables or procedures. Name-conflict problems can occur if an EPS file
does not initialize its variables
before
defining its procedures—in particular,
before binding them. In the following example, the variable
x
is not initial-
ized before being used in the procedure
proc1.
Because the value of
x
in the
enclosing program happens to be an operator,
bind
causes the name
x
to be
replaced by the operator
lineto
in
proc1
. This causes a
stackunderflow
error
upon execution.
%!PS-Adobe-3.0
...Document prolog of including application...
/x /lineto load def
% Application defines x to be lineto
2 Guidelines for Creating EPS Files
11
Home Index Bookmark Pages
Pages: Home Index