Figure 5
Application coordinate system plus placement box
0,0
20,20
right,top
left,bottom
60,60
To transform the PostScript coordinate system to match the application
coordinate system in Figure 5, an application could execute the following
code fragment:
0 792 translate
1 –1 scale
This assumes that each unit of application space is equal to one PostScript
unit. If one unit in application space were equal to five PostScript units, then
the transformation might look like this:
0 792 translate
5 –5 scale
Assuming that the coordinate system has already been properly translated
and scaled from the PostScript coordinate system to the application coordi-
nate system as above, then the following steps can be used to place the EPS
file in the user-chosen box:
1.
left bottom
translate
2. ((
right – left
)/(
urx – llx
)) (
top – bottom
)/(
ury – lly
)
scale
3.
(
llx
)
(
lly
)
translate
where
bottom
,
left
,
top
, and
right
are coordinates of the placement box in
application space, and
llx
,
lly
,
urx
, and
ury
are bounding box parameters the
EPS file supplies.
As a final example, assume that the PostScript coordinate system has already
been transformed to match the application coordinate system, the EPS file
bounding box is
%%BoundingBox: 20 20 100 100
,
and the user-chosen
3 Guidelines for Importing EPS Files
19
Home Index Bookmark Pages
Pages: Home Index