I convert jpeg
image to eps(encapsulated postscript) via jpeg2ps, now I want to embed newly created eps in PS(postscript) file, any idea?
Actually in ps
there are about 80 pages, I want to put eps
file code in postscript as a header, and in all 80 pages I just want to use its reference to minimize the siz开发者_开发问答e of postscript.
This was offered to me years ago by Tom Greer via Tek-tips. We have been using this code for almost a decade and has always worked flawlessly:
/ImageData
currentfile
<< /Filter /SubFileDecode
/DecodeParms << /EODString (*EOD*) >>
>> /ReusableStreamDecode filter
[-->PUT YOUR EPS HERE<--]
*EOD*
def
/IDForm
<< /FormType 1
/BBox [154 321 441 521]
/Matrix [ 1 0 0 1 0 0]
/PaintProc
{ pop
/ostate save def
/showpage {} def
/setpagedevice /pop load def
ImageData 0 setfileposition ImageData cvx exec
ostate restore
} bind
>> def
And to use your EPS:
gsave
IDForm execform
grestore
We embed numerous EPS files in all our print jobs so they are portable. If you do similarly you need to keep renaming to function that reads the data and the form function accordingly.
Your question is answered in the Encapsulated PostScript File Format Specification (only 34 pages, don't be scared!) available from Adobe. It wouldn't make sense to duplicate the information here, the reference documentation is actually quite concise and clear and also includes examples.
精彩评论