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
I would suggest a simple way - run an EPS file.
First, convert the image to EPS, ex. myimage.eps, save it in myfolder and then modify your code to define placeEPS operator and display myimage.eps by using it.
%!PS-Adobe-3.0
% Place EPS image definition
% Syntax: placeEPS
% =============================================================
/placeEPS
{
userdict begin
/__be_state save def
/__ds_count countdictstack def
/__os_count count 5 sub def
/showpage {} def
initgraphics
translate
dup scale
run
count __os_count sub { pop } repeat
countdictstack __ds_count sub { end } repeat
__be_state restore
end
} bind def
% =============================================================
% Your old code starts here
/Times-Roman findfont
12 scalefont setfont
50 700 moveto
(text) show
% Now mark myimage.eps scaled to 100% at position 100, 100
(myfolder/myimage.eps) 1 100 100 placeEPS
showpage
Now convert to PDF by Acrobat Distiller or GhostScript.
You can also use this approach to place a full-page canvas to a document.