Search code examples
ghostscriptpostscripteps

Insert EPS image into PostScript document


For inserting an external EPS file into a PostScript document, it is instructed to open the EPS file with text editor and copy/paste the text-based data within the PostScript file.

I wonder if there is a standard approach to include the external EPS file inside the PostScript document? I mean linking to the EPS file, as PS can catch and read its content when running the PostScript document. I've read something about run command, but have no idea how to use it for including external EPS file within main PostScript document.

UPDATE: When inserting the EPS image as

%!PS-Adobe-3.0

/Times-Roman findfont
14 scalefont setfont

72 700 moveto
(Thi is a text) show

72 300 translate
(1.eps)run

72 100 moveto
(Another text bellow image) show
showpage

it sends to the next page. In this example, the second text goes to page 2, instead of displaying at position )72 100.


Solution

  • Assuming your EPS file is in the same directory as your main PostScript file and is called my.eps. Then you could put this line into the code of your PostScript file:

    (my.eps) run
    

    You'll have to work out at which exact position this line should go to cause the wanted effect. Probably just before the showpage operator would be a good place to start.