Reputation: 31
how to add image file with itextSharp in asp.net C#. And which namespace is required
Image jpg** = Image.GetInstance(new Uri(URL))
Upvotes: 2
Views: 3427
Reputation: 680
You can try this
using(Stream ImageStream = new FileStream(imageUrl, FileMode.Open, FileAccess.Read, FileShare.Read))
Image image = Image.GetInstance(ImageStream);
Upvotes: 0
Reputation: 1376
You can use iTextSharp.text.Image
for adding images. Something like this:
iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(image, System.Drawing.Imaging.ImageFormat.Jpeg);
myDocument.Add(pic);
Where myDocument is the object of Document
Class of itextsharp
Here if one details article which discuss handling images in itextsharp
http://www.mikesdotnetting.com/Article/87/iTextSharp-Working-with-images
and may be you might be interested in going through documentation also, so here is the link:
http://sourceforge.net/projects/itextsharp/
Upvotes: 1