How include img in postscript

后端 未结 3 1856
盖世英雄少女心
盖世英雄少女心 2020-12-10 08:03

I want to add image to my postscript code

%!PS-Adobe-3.0

/Times-Roman findfont
12 scalefont setfont

50 700 moveto
(text) show
showpage

bu

3条回答
  •  -上瘾入骨i
    2020-12-10 08:59

    See the PostScript Language Reference Manual, this is not a trivial subject and you will need to read carefully. Start with Section 4.10 and read at least the sections dealing with type 1 images (4.10.1 to 4.10.5).

    Here is a simple example:

    /OneComponentString <007ff700> def
    
    /OneComponentImage1
    {
    <<
    /ImageType 1
    /Width 2
    /Height 2
    /ImageMatrix [2 0 0 -2 0 2]
    /BitsPerComponent 8
    /Decode [0 1]
    /DataSource OneComponentString
    >>
    } bind def
    
    gsave
    0 0 moveto
    20 20 scale
    /DeviceGray setcolorspace
    OneComponentImage1 image
    grestore
    
    showpage
    

提交回复
热议问题