Embed eps file in ps

。_饼干妹妹 提交于 2019-12-11 05:32:11

问题


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 size of postscript.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2948683/embed-eps-file-in-ps

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!