Insert an image on every page of a postscript file
Copy link to clipboard
Copied
Hello,
I am generating a ps file of a document using ps printer.
on every page of the document i want to print my image.
so please help me how to insert my image in ps file to print image on all pages
Regards,
Vijay
Copy link to clipboard
Copied
%!PS
/imgFile
Below is an example of a simple image using a reusable stream on each page.
%!PS
/imgFile
currentfile
<< /Filter /SubFileDecode
/DecodeParms << /EODCount 0 /EODString (%%*EOD*) >>
>> /ReusableStreamDecode filter
f011
ff00
ff00
0000
0000
0000
ff00
ff00
ff00
ff00
ff00
0ff0
00ff
00ff
00ff
ee00
%%*EOD*
def
/doimage
{
10 10 scale
36 36 translate
/temp 4 string def
<<
/ImageType 1
/Width 16
/Height 16
/BitsPerComponent 1
/Decode [ 1 0 ] % 1 is on 0 is off
/ImageMatrix [1 0 0 1 0 0]
/DataSource { imgFile temp readhexstring pop }
>>
imagemask
imgFile resetfile
}def
<<
/EndPage {pop pop save initgraphics doimage restore true}
>> setpagedevice
/Helvetica 72 selectfont
72 720 moveto
(PAGE 1) show
showpage
72 720 moveto
(PAGE 2) show
showpage

