DaniL
DaniL

Reputation: 23

EPS inside EPS as a link - any alternative to "run" command?

Maybe this is a dumb question but I have zero experience in PostScript/EPS and I need to (try and) solve a problem I got (the functionality worked in the past...so I am told). All is under Windows 7 x64.

The requirement asks to Link an EPS file inside another EPS file. The way it was done was using the "run" command along with "translate" and "scale" in order to fit the child.eps into parent.eps. (this is done by a Java class)

Consider the following (simplified) example:

%!PS-Adobe-3.0 EPSF-3.0
%!PS-Adobe EPSF-3.0
%%BoundingBox: 0 0 800 200

/Courier findfont 70 scalefont setfont
10 10 moveto
(Hello World!) show
%%EOF

The above works fine but if, before %%EOF, I add

(child.eps) run

I get quite strange behaviors (tried this on 3 Windows PCs with exact same results):

What am I missing? Or what am I doing wrong?

Is there any other way to link an EPS inside another EPS besides using the "run" command so I can get consistent results?

Thanks!

LE: both, Parent.eps and Child.eps are in the same folder

Upvotes: 0

Views: 184

Answers (1)

KenS
KenS

Reputation: 31199

The PostScript language doesn't have any concept of a 'link'. Not surprising when you consider that PostScript is a programming language.

Surprisingly, executing 'run' in an EPS file doesn't makes it an invalid EPS.

This is surprising to me because what you are supposed to do is include the subsidiary EPS file inside the parent. The whole point of an EPS file is that its a 'black box', to get it to work an encapsulating PostScript program merely needs to set up the CTM to scale the EPS into the space it wants, then execute the EPS. The EPS should not have any side effect.

Anyway, there is nothing else in PostScript which will do what you want. I strongly suspect that either Illustrator is shipping with no PostScript interpreter at all, or its restricted in some fashion for security reasons. Illustrator is not a reliable means for testing if PostScript is valid!

Why do you want to load it into Illustrator ? Have you considered using PDF instead of EPS ?

Upvotes: 1

Related Questions