Example 2:
/BeginEPSF { %def
/b4_Inc_state save def
% Save state for cleanup
/dict_count countdictstack def
% Count objects on dict stack
/op_count count 1 sub def
% Count objects on operand stack
userdict begin
% Push userdict on dict stack
/showpage { } def
% Redefine showpage, { } = null proc
0 setgray 0 setlinecap
% Prepare graphics state
1 setlinewidth 0 setlinejoin
10 setmiterlimit [ ] 0 setdash newpath
/languagelevel where
% If level not equal to 1 then
{pop languagelevel
% set strokeadjust and
1 ne
% overprint to their defaults.
{false setstrokeadjust false setoverprint
} if
} if
} bind def
Example 3: shows procedure
EndEPSF
, which illustrates how to restore the
PostScript state to the way it was before inclusion and execution of the EPS
file. Execute the
EndEPSF
procedure after the EPS file.
Example 3:
/EndEPSF { %def
count op_count sub {pop} repeat
% Clean up stacks
countdictstack dict_count sub {end} repeat
b4_Inc_state restore
} bind def
Example 4: illustrates use of the
BeginEPSF
and
EndEPSF
procedures.
Example 4:
BeginEPSF
left bottom
translate
angle
rotate
Xscale Yscale
scale
-llx -lly
translate
...Set up a clipping path...
%%BeginDocument: MyEPSFile
...Included EPS file here...
%%EndDocument
EndEPSF
% Prepare for the included EPS file
% Place the EPS file
% Restore state, and cleanup stacks
3 Guidelines for Importing EPS Files
21
Home Index Bookmark Pages
Pages: Home Index