Draws PostScript from a string spec onto a canvas.


Rectangle DrawPostscript(string inPS, DrawOptions inOptions);

[Visual Basic]

Function DrawPostscript(inPS As String, inOptions As DrawOptions) As Rectangle
Name Description
inPS The string of Postscript to be rendered on the canvas.
inOptions The draw options
return The area drawn.

This allows you to draw a string of Postscript onto the Canvas. The postscript can be any Level 3 postscript as described in the 'Postscript Language Reference Third Edition' from Adobe Systems.

If the size of the canvas has not been previously determined, the Canvas will be sized as an 8.5 x 11 inch page with image width and height determined by the current value of HRes and VRes.



string myps = "/Courier findfont 10 scalefont setfont";
myps += " 1 1 0 setrgbcolor";
myps += " 10 7 moveto (Copyright 1992, my picture productions) show";
Canvas canvas = new Canvas(Server.MapPath("rez/sunset.jpg"));
canvas.DrawPostscript(myps, new DrawOptions());

[Visual Basic]

Dim myps As String = "/Courier findfont 10 scalefont setfont"
myps += " 1 1 0 setrgbcolor"
myps += " 10 7 moveto (Copyright 1992, my picture productions) show"
Dim canvas As New Canvas(Server.MapPath("rez/sunset.jpg"))
canvas.DrawPostscript(myps, New DrawOptions())

The code above creates a new png file with the postscript rendered over the top of the picture. The original and annotated pictures are shown below.