Load an image from stream.




void SetStream(Stream stream)

[Visual Basic]
Sub SetStream(stream As Stream)

Throws Exceptions may throw Exception()



Name Description
Stream The stream containing the graphic.




Load an image from stream.

The stream can contain any of the following types: JPEG, GIF, TIFF, BMP, PNG, PSD, PDB, EXIF, WMF, EMF, EPS, PS or SWF (Flash).

Ultimately each import goes through a ReadModule so for details of additional formats supported and the way they are imported, see the ReadModule property.

Different images within the file can be accessed using the Frame property. Different portions of the image can be selected using the Selection property.




Here we read a TIFF file and present the data to the XImage object. We then add the image to our document and then save the PDF.


XImage theImg = new XImage(); string thePath; thePath = Server.MapPath("../mypics/mypic.jpg"); Stream theStream; theStream = File.OpenRead(thePath); theImg.SetStream(theStream); theStream.Close(); Doc doc = new Doc(); doc.Rect.Inset(20, 20); doc.AddImageObject(theImg, false); theImg.Clear(); doc.Save(Server.MapPath("imagesetstream.pdf")); doc.Clear();