This example shows how to load an image into a PixMap and then
draw it on the current page using the AddXObject method.
using (Doc doc = new Doc()) {
doc.Rect.Inset(50, 50);
doc.Transform.Rotate(20, 200, 200);
doc.Color.SetRgb(200, 200, 255);
doc.FillRect();
PixMap pm = new PixMap(doc.ObjectSoup);
Bitmap img = (Bitmap)Bitmap.FromFile(Server.MapPath("mypics/mypic.png"));
pm.SetBitmap(img, true);
doc.AddXObject(pm);
doc.Save(Server.MapPath("examplePixMapBitmap.pdf"));
}
Using doc As New Doc()
doc.Rect.Inset(50, 50)
doc.Transform.Rotate(20, 200, 200)
doc.Color.SetRgb(200, 200, 255)
doc.FillRect()
Dim pm As New PixMap(doc.ObjectSoup)
Dim img As Bitmap = DirectCast(Bitmap.FromFile(Server.MapPath("mypics/mypic.png")), Bitmap)
pm.SetBitmap(img, True)
doc.AddXObject(pm)
doc.Save(Server.MapPath("examplePixMapBitmap.pdf"))
End Using